Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
69b7fc4
Update types and RuleContext deprecations
tylermumford Dec 30, 2025
9c686b5
Addresses the feedback provided in the comments on
ledsun Feb 9, 2026
a7b967b
Add ESLint 10 to the Node 18+ CI matrix
ledsun Feb 11, 2026
9932114
ci(types): split type-check matrix by ESLint major (7/10)
ledsun Feb 11, 2026
54908ab
fix(types): align rule context usage with ESLint 10 typings
ledsun Feb 11, 2026
56cd100
chore: add ESLint v10 support to package.json
ledsun Feb 11, 2026
d143827
chore: Add ESLint v10 support to peer dependency
ledsun Feb 11, 2026
4b2162e
ci(type-check): install eslint before typescript in test-published-types
ledsun Feb 11, 2026
1cbaa2f
ci(type-check): limit ESLint 10 matrix to TypeScript 5+
ledsun Feb 11, 2026
4daabd7
Apply suggestions from code review
ledsun Feb 12, 2026
ce94759
Fix getFilename utility and import usage in version resolver
ledsun Feb 12, 2026
33e30c8
Reverse unintended changes
ledsun Feb 13, 2026
745d588
fix(types): avoid RulesMetaDocs excess-property check in makeNoMethod…
ledsun Feb 15, 2026
3023a29
chore(peer-deps): drop eslint v10 from declared support range
ledsun Feb 15, 2026
808ca3c
chore(dev-deps): drop eslint v10 from development range
ledsun Feb 15, 2026
15a8614
refactor(version): import only getFilename from eslint util
ledsun Feb 15, 2026
3fbb319
ci: run ESLint 10 matrix jobs on Node 20+ only
ledsun Feb 15, 2026
939967d
ci: exclude ESLint 10 + babel-eslint 8 from matrix
ledsun Feb 15, 2026
a3a41eb
ci: use @typescript-eslint/parser@canary for ESLint 10 as temporary w…
ledsun Feb 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/node-18+.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
eslint:
- 10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll also need to exclude eslint 10 on node < 20

- 9
- 8
- 7
Expand All @@ -44,6 +45,13 @@ jobs:
- 7
- 8
exclude:
# ESLint 10 supports Node.js 20+.
- eslint: 10
node-version: 18
- eslint: 10
node-version: 19
- eslint: 10
babel-eslint: 8
- eslint: 3
babel-eslint: 10
- eslint: 3
Expand Down Expand Up @@ -104,7 +112,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
after_install: |
npm install --no-save "eslint@${{ matrix.eslint }}" "@typescript-eslint/parser@${{ matrix.typescript-eslint == 8 && 8.17 || matrix.typescript-eslint }}" "babel-eslint@${{ matrix.babel-eslint }}"
npm install --no-save "eslint@${{ matrix.eslint }}" "@typescript-eslint/parser@${{ matrix.eslint == 10 && 'canary' || (matrix.typescript-eslint == 8 && '8.17' || matrix.typescript-eslint) }}" "babel-eslint@${{ matrix.babel-eslint }}"
env:
NPM_CONFIG_LEGACY_PEER_DEPS: "${{ matrix.typescript-eslint >= 6 && 'false' || 'true' }}"
- run: npx ls-engines
Expand Down
39 changes: 38 additions & 1 deletion .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ permissions:

jobs:
test:
name: TS ${{ matrix.ts_version }}, "${{ matrix.ts_lib }}"
name: ESLint ${{ matrix.eslint_version }}, TS ${{ matrix.ts_version }}, "${{ matrix.ts_lib }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
eslint_version:
- '7'
- '10'
ts_version:
# The official ESLint types are not compatible with TS 3.9
# - 3.9
Expand All @@ -29,6 +32,20 @@ jobs:
- es2015,dom
- es2020
- esnext
exclude:
# ESLint 10 jobs are only run with TS >= 5.0.
- eslint_version: '10'
ts_version: '4.0'
- eslint_version: '10'
ts_version: 4.1
- eslint_version: '10'
ts_version: 4.2
- eslint_version: '10'
ts_version: 4.3
- eslint_version: '10'
ts_version: 4.4
- eslint_version: '10'
ts_version: 4.5
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -41,6 +58,17 @@ jobs:
node-version: 'lts/*'
skip-ls-check: true

- name: select eslint types
run: |
if [ "${{ matrix.eslint_version }}" = "10" ]; then
# Avoid dev dependency peer conflicts with eslint@10.
npm prune --omit=dev
npm uninstall --no-save @types/eslint
npm install --no-save --legacy-peer-deps eslint@^10 typescript@^5
else
npm install --no-save eslint@^7 @types/eslint@7.2.10
fi

- name: build types
run: npm run build-types

Expand All @@ -60,6 +88,15 @@ jobs:
run: npm install
working-directory: test-published-types

- name: select eslint for published types
run: |
if [ "${{ matrix.eslint_version }}" = "10" ]; then
npm install --no-save eslint@^10
else
npm install --no-save eslint@^7
fi
working-directory: test-published-types

- name: install eslint-plugin-react and typescript version ${{ matrix.ts_version }}
run: npm install --no-save "$ESLINT_PLUGIN_REACT_PATH" typescript@${{ matrix.ts_version }}
working-directory: test-published-types
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/forward-ref-uses-ref.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

const isParenthesized = require('../util/ast').isParenthesized;
const docsUrl = require('../util/docsUrl');
const getSourceCode = require('../util/eslint').getSourceCode;
const report = require('../util/report');
const getMessageData = require('../util/message');

Expand Down Expand Up @@ -57,7 +58,7 @@ module.exports = {
},

create(context) {
const sourceCode = context.getSourceCode();
const sourceCode = getSourceCode(context);

return {
'FunctionExpression, ArrowFunctionExpression'(node) {
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-filename-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

const path = require('path');
const docsUrl = require('../util/docsUrl');
const getFilename = require('../util/eslint').getFilename;
const report = require('../util/report');

// ------------------------------------------------------------------------------
Expand Down Expand Up @@ -61,7 +62,7 @@ module.exports = {
},

create(context) {
const filename = context.getFilename();
const filename = getFilename(context);

let jsxNode;

Expand Down
5 changes: 5 additions & 0 deletions lib/util/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ function getSourceCode(context) {
return context.getSourceCode ? context.getSourceCode() : context.sourceCode;
}

function getFilename(context) {
return context.getFilename ? context.getFilename() : context.filename;
}

function getAncestors(context, node) {
const sourceCode = getSourceCode(context);
return sourceCode.getAncestors ? sourceCode.getAncestors(node) : context.getAncestors();
Expand Down Expand Up @@ -38,6 +42,7 @@ function getText(context) {

module.exports = {
getAncestors,
getFilename,
getFirstTokens,
getScope,
getSourceCode,
Expand Down
14 changes: 8 additions & 6 deletions lib/util/makeNoMethodSetStateRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ function shouldBeNoop(context, methodName) {
* @returns {import('eslint').Rule.RuleModule}
*/
module.exports = function makeNoMethodSetStateRule(methodName, shouldCheckUnsafeCb) {
const docs = {
description: `Disallow usage of setState in ${methodName}`,
category: 'Best Practices',
recommended: false,
url: docsUrl(mapTitle(methodName)),
};

return {
meta: {
docs: {
description: `Disallow usage of setState in ${methodName}`,
category: 'Best Practices',
recommended: false,
url: docsUrl(mapTitle(methodName)),
},
docs,

messages,

Expand Down
3 changes: 2 additions & 1 deletion lib/util/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const path = require('path');
const resolve = require('resolve');
const semver = require('semver');
const error = require('./error');
const getFilename = require('./eslint').getFilename;

const ULTIMATE_LATEST_SEMVER = '999.999.999';

Expand All @@ -28,7 +29,7 @@ function resetDetectedVersion() {

function resolveBasedir(contextOrFilename) {
if (contextOrFilename) {
const filename = typeof contextOrFilename === 'string' ? contextOrFilename : contextOrFilename.getFilename();
const filename = typeof contextOrFilename === 'string' ? contextOrFilename : getFilename(contextOrFilename);
const dirname = path.dirname(filename);
try {
if (fs.statSync(filename).isFile()) {
Expand Down
13 changes: 13 additions & 0 deletions types/eslint-core-augment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import '@eslint/core';

declare module '@eslint/core' {
interface SettingsConfig {
react?: {
pragma?: string;
fragment?: string;
createClass?: string;
};
}
}

export {};
Loading