chore: Migrate ESLint configuration file to new flat format. (#8675)

* chore: rename .eslintrc.js to eslint.config.js

* chore: Rename eslint.config.js to eslint.config.mjs.

* refactor: Migrate ESLint config to new flat format.

* chore: Remove old per-directory and global ignore ESLint config files.

* fix: Allowlist JSDoc tag aliases.

* fix: Don't require @license in tests/*.

* fix: Add NodeJS globals to several files that run under Node.

* chore: Remove now-unneeded ESLint directives in core.

* chore: Remove invalid/unneeded ESLint directives.

* fix: Fix invalid use of `await` outside of an `async` function.

* fix: Improve screenshot error message.

* fix: Update ESLint config file to not warn on existing violations.

* chore: Remove suppressions of rules that weren't triggering.

* chore: Fix package-lock.json.
This commit is contained in:
Aaron Dodson
2024-12-03 12:40:48 -08:00
committed by GitHub
parent 61bbd7dbf6
commit 5870c66cf0
22 changed files with 716 additions and 719 deletions

View File

@@ -30,7 +30,6 @@ export interface ISerializer {
* state to record.
*/
save(workspace: Workspace): object | null;
/* eslint-enable valid-jsdoc */
/**
* Loads the state of the plugin or system.

View File

@@ -31,16 +31,12 @@ export class ConstantProvider extends BaseConstantProvider {
override getCSS_(selector: string) {
return super.getCSS_(selector).concat([
/* eslint-disable indent */
/* clang-format off */
// Insertion marker.
`${selector} .blocklyInsertionMarker>.blocklyPathLight,`,
`${selector} .blocklyInsertionMarker>.blocklyPathDark {`,
`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,
`stroke: none;`,
'}',
/* clang-format on */
/* eslint-enable indent */
]);
}
}

View File

@@ -786,7 +786,6 @@ export class ConstantProvider extends BaseConstantProvider {
override getCSS_(selector: string) {
return [
/* eslint-disable indent */
// Text.
`${selector} .blocklyText,`,
`${selector} .blocklyFlyoutLabelText {`,
@@ -871,4 +870,3 @@ export class ConstantProvider extends BaseConstantProvider {
];
}
}
/* eslint-enable indent */

View File

@@ -32,9 +32,6 @@ import {
import * as priorities from './priorities.js';
import * as serializationRegistry from './registry.js';
// TODO(#5160): Remove this once lint is fixed.
/* eslint-disable no-use-before-define */
/**
* Represents the state of a connection.
*/
@@ -795,7 +792,6 @@ const saveBlock = save;
export class BlockSerializer implements ISerializer {
priority: number;
/* eslint-disable-next-line require-jsdoc */
constructor() {
/** The priority for deserializing blocks. */
this.priority = priorities.BLOCKS;

View File

@@ -26,7 +26,6 @@ export interface State {
export class VariableSerializer implements ISerializer {
priority: number;
/* eslint-disable-next-line require-jsdoc */
constructor() {
/** The priority for deserializing variables. */
this.priority = priorities.VARIABLES;

View File

@@ -202,7 +202,6 @@ export function generateUniqueNameFromOptions(
let letterIndex = letters.indexOf(startChar);
let potName = startChar;
// eslint-disable-next-line no-constant-condition
while (true) {
let inUse = false;
for (let i = 0; i < usedNames.length; i++) {

View File

@@ -1077,14 +1077,12 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
* @internal
*/
updateScreenCalculationsIfScrolled() {
/* eslint-disable indent */
const currScroll = svgMath.getDocumentScroll();
if (!Coordinate.equals(this.lastRecordedPageScroll, currScroll)) {
this.lastRecordedPageScroll = currScroll;
this.updateScreenCalculations();
}
}
/* eslint-enable indent */
/**
* @returns The layer manager for this workspace.