Skip to content

Commit

Permalink
chore: Migrate ESLint configuration file to new flat format. (#8675)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
gonfunko authored Dec 3, 2024
1 parent 61bbd7d commit 5870c66
Show file tree
Hide file tree
Showing 22 changed files with 715 additions and 718 deletions.
28 changes: 0 additions & 28 deletions .eslintignore

This file was deleted.

189 changes: 0 additions & 189 deletions .eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion core/interfaces/i_serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 0 additions & 4 deletions core/renderers/geras/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
]);
}
}
2 changes: 0 additions & 2 deletions core/renderers/zelos/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ export class ConstantProvider extends BaseConstantProvider {

override getCSS_(selector: string) {
return [
/* eslint-disable indent */
// Text.
`${selector} .blocklyText,`,
`${selector} .blocklyFlyoutLabelText {`,
Expand Down Expand Up @@ -871,4 +870,3 @@ export class ConstantProvider extends BaseConstantProvider {
];
}
}
/* eslint-enable indent */
4 changes: 0 additions & 4 deletions core/serialization/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion core/serialization/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion core/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 0 additions & 2 deletions core/workspace_svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 5870c66

Please sign in to comment.