-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[Feat]: provide compatibility with eslint v9 #3727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cbe8e69
85bb38c
11e42ba
70eeb92
029e253
45cc7db
87bf6c6
d87ada8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ jobs: | |
matrix: | ||
node-version: ${{ fromJson(needs.matrix.outputs.latest) }} | ||
eslint: | ||
- 9 | ||
- 8 | ||
- 7 | ||
- 6 | ||
|
@@ -48,6 +49,7 @@ jobs: | |
npm install --no-save "eslint@${{ matrix.eslint }}" "@typescript-eslint/parser@5" "babel-eslint@${{ matrix.babel-eslint }}" | ||
env: | ||
NPM_CONFIG_LEGACY_PEER_DEPS: true | ||
ESLINT_USE_FLAT_CONFIG: false | ||
- run: npx ls-engines | ||
- run: npm run unit-test | ||
- uses: codecov/[email protected] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,11 +87,12 @@ module.exports = { | |
|
||
/** | ||
* Find a variable by name in the current scope. | ||
* @param {string} name Name of the variable to look for. | ||
* @param {ASTNode} node The node to check. | ||
* @returns {ASTNode|null} Return null if the variable could not be found, ASTNode otherwise. | ||
*/ | ||
function findVariableByName(name) { | ||
const variable = variableUtil.variablesInScope(context).find((item) => item.name === name); | ||
function findVariableByName(node) { | ||
const name = node.name; | ||
const variable = variableUtil.variablesInScope(context, node).find((item) => item.name === name); | ||
Comment on lines
+94
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it seems like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right - but providing the third argument to |
||
|
||
if (!variable || !variable.defs[0] || !variable.defs[0].node) { | ||
return null; | ||
|
@@ -147,7 +148,7 @@ module.exports = { | |
if (node.type === 'ObjectExpression') { | ||
checkSorted(node.properties); | ||
} else if (node.type === 'Identifier') { | ||
const propTypesObject = findVariableByName(node.name); | ||
const propTypesObject = findVariableByName(node); | ||
if (propTypesObject && propTypesObject.properties) { | ||
checkSorted(propTypesObject.properties); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.