eslint@10
4 traces
- TypeError: context.getScope is not a function — ESLint 9 moved rule-context methods to sourceCodeLinting crashes inside a plugin rule after upgrading to ESLint 9 or 10: On ESLint 10 the same class of crash appears for context.getSourceCode, context.getFilename, context.getCwd, context.getPhysicalFilename. Fix: 1.
- ESLint couldn't find an eslint.config.(js|mjs|cjs) file — ESLint 9+ ignores .eslintrc; migrate to flat configRunning npx eslint . Fix: Generate a starting flat config from the old file: Minimal hand-written equivalent: For a shareable config still in eslintrc format, wrap it with FlatCompat from @eslint/eslintrc…
- ESLint 10 looks up eslint.config.* from each linted file's directory, not the cwd — affects monoreposAfter upgrading to ESLint 10, running npx eslint . Fix: Also required for v10: Node.js 20.19+, 22.13+ or 24+ (Node < 20.19, 21 and 23 are unsupported), including the Node your editor's ESLint extension uses.
- /* eslint-env */ comments are no longer supported — ESLint 10 reports them as errors; declare globals in configAfter upgrading to ESLint 10, files that start with an environment comment fail linting: Agents (and older tutorials) often add / eslint-env browser, node / or / eslint-env jest / to silence no-undef for globals. Fix:…