-
Notifications
You must be signed in to change notification settings - Fork 6
Updates to support ESLint 9.x #61
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yarn format && yarn lint && yarn test |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright (c) 2025, salesforce.com, inc. | ||
* All rights reserved. | ||
* SPDX-License-Identifier: MIT | ||
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
const js = require('@eslint/js'); | ||
const nodePlugin = require('eslint-plugin-n'); | ||
const eslintPlugin = require('eslint-plugin-eslint-plugin'); | ||
const tseslint = require('typescript-eslint'); | ||
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. Added TypeScript linting for the |
||
|
||
module.exports = [ | ||
{ | ||
ignores: ['test/**/test.js', 'reports/**'] | ||
}, | ||
{ | ||
...js.configs.recommended, | ||
...nodePlugin.configs['flat/recommended-script'], | ||
files: ['**/*.js'], | ||
languageOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
globals: { | ||
// jest globals | ||
jest: 'readonly', | ||
describe: 'readonly', | ||
it: 'readonly', | ||
expect: 'readonly', | ||
beforeEach: 'readonly', | ||
afterEach: 'readonly', | ||
beforeAll: 'readonly', | ||
afterAll: 'readonly' | ||
} | ||
}, | ||
rules: { | ||
strict: ['error', 'global'] | ||
} | ||
}, | ||
...tseslint.configs.recommended.map((config) => ({ | ||
...config, | ||
files: ['**/*.d.ts'] | ||
})), | ||
{ | ||
files: ['lib/rules/*.js'], | ||
plugins: { | ||
'eslint-plugin': eslintPlugin | ||
}, | ||
...eslintPlugin.configs['flat/recommended'], | ||
rules: { | ||
'eslint-plugin/prefer-message-ids': 'off' // Messages come straight from Komaci. | ||
} | ||
} | ||
]; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ | |
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
'use strict'; | ||
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 are going to be a lot of these to ignore, unfortunately. Apparently this isn't required for modules, and throws linting exceptions if you keep them. |
||
|
||
module.exports = { | ||
displayName: 'Unit Tests', | ||
setupFilesAfterEnv: ['jest-extended', 'jest-chain'], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
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.
|
||
* Copyright (c) 2022, salesforce.com, inc. | ||
* All rights reserved. | ||
* SPDX-License-Identifier: MIT | ||
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
module.exports = { | ||
plugins: ['@salesforce/lwc-graph-analyzer'], | ||
parser: '@babel/eslint-parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
requireConfigFile: false, | ||
sourceType: 'module', | ||
babelOptions: { | ||
parserOpts: { | ||
plugins: [['decorators', { decoratorsBeforeExport: false }]] | ||
} | ||
} | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,21 @@ | |
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
'use strict'; | ||
const bundleAnalyzer = require('../processor'); | ||
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.
|
||
|
||
module.exports = { | ||
plugins: ['@salesforce/lwc-graph-analyzer'], | ||
parser: '@babel/eslint-parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
requireConfigFile: false, | ||
sourceType: 'module', | ||
babelOptions: { | ||
parserOpts: { | ||
plugins: [['decorators', { decoratorsBeforeExport: false }]] | ||
files: ['*.html', '**/*.html', '*.js', '**/*.js'], | ||
processor: bundleAnalyzer, | ||
languageOptions: { | ||
parser: require('@babel/eslint-parser'), | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
requireConfigFile: false, | ||
sourceType: 'module', | ||
babelOptions: { | ||
parserOpts: { | ||
plugins: [['decorators', { decoratorsBeforeExport: false }]] | ||
} | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright (c) 2022, salesforce.com, inc. | ||
* All rights reserved. | ||
* SPDX-License-Identifier: MIT | ||
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
module.exports = { | ||
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.
|
||
extends: ['./configs/base-legacy'], | ||
rules: {}, | ||
overrides: [ | ||
{ | ||
files: ['*.html', '**/*.html', '*.js', '**/*.js'], | ||
processor: '@salesforce/lwc-graph-analyzer/bundleAnalyzer', | ||
rules: { | ||
'@salesforce/lwc-graph-analyzer/no-getter-contains-more-than-return-statement': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-assignment-expression-assigns-value-to-member-variable': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-references-non-local-property-reactive-value': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-private-wire-config-property': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-unresolved-parent-class-reference': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-class-refers-to-parent-class-from-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-reference-to-unsupported-namespace-reference': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-uses-getter-function-returning-inaccessible-import': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-uses-getter-function-returning-non-literal': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-circular-wire-dependency': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-configuration-property-using-output-of-non-primeable-wire': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-missing-resource-cannot-prime-wire-adapter': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-uses-imported-artifact-from-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-adapter-of-resource-cannot-be-primed': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-unsupported-member-variable-in-member-expression': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-multiple-template-files': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-assignment-expression-for-external-components': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-tagged-template-expression-contains-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-expression-contains-module-level-variable-ref': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-call-expression-references-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-eval-usage': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-reference-to-class-functions': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-reference-to-module-functions': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-functions-declared-within-getter-method': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-non-existent-member-variable': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-unsupported-namespace-reference': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-contains-non-portable-identifier': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-super-class': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-unsupported-global': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-getter-property': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-property-from-unresolvable-wire': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-property-missing': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-property-non-public': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-render-function-contains-more-than-return-statement': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-render-function-return-statement-not-returning-imported-template': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-render-function-return-statement': 'warn' | ||
} | ||
} | ||
] | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,80 +5,63 @@ | |
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
*/ | ||
|
||
'use strict'; | ||
const baseConfig = require('./base'); | ||
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. ...and |
||
|
||
module.exports = { | ||
extends: ['./configs/base'], | ||
overrides: [ | ||
{ | ||
files: ['*.html', '**/*.html', '*.js', '**/*.js'], | ||
processor: '@salesforce/lwc-graph-analyzer/bundleAnalyzer', | ||
rules: { | ||
'@salesforce/lwc-graph-analyzer/no-getter-contains-more-than-return-statement': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-assignment-expression-assigns-value-to-member-variable': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-references-non-local-property-reactive-value': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-private-wire-config-property': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-unresolved-parent-class-reference': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-class-refers-to-parent-class-from-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-reference-to-unsupported-namespace-reference': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-uses-getter-function-returning-inaccessible-import': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-uses-getter-function-returning-non-literal': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-circular-wire-dependency': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-configuration-property-using-output-of-non-primeable-wire': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-missing-resource-cannot-prime-wire-adapter': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-uses-imported-artifact-from-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-adapter-of-resource-cannot-be-primed': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-unsupported-member-variable-in-member-expression': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-multiple-template-files': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-assignment-expression-for-external-components': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-tagged-template-expression-contains-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-expression-contains-module-level-variable-ref': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-call-expression-references-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-eval-usage': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-reference-to-class-functions': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-reference-to-module-functions': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-functions-declared-within-getter-method': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-non-existent-member-variable': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-unsupported-namespace-reference': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-contains-non-portable-identifier': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-super-class': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-unsupported-global': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-getter-property': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-property-from-unresolvable-wire': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-property-missing': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-property-non-public': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-render-function-contains-more-than-return-statement': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-render-function-return-statement-not-returning-imported-template': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-render-function-return-statement': 'warn' | ||
} | ||
} | ||
] | ||
...baseConfig, | ||
rules: { | ||
'@salesforce/lwc-graph-analyzer/no-getter-contains-more-than-return-statement': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-assignment-expression-assigns-value-to-member-variable': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-references-non-local-property-reactive-value': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-private-wire-config-property': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-unresolved-parent-class-reference': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-class-refers-to-parent-class-from-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-reference-to-unsupported-namespace-reference': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-uses-getter-function-returning-inaccessible-import': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-uses-getter-function-returning-non-literal': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-circular-wire-dependency': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-configuration-property-using-output-of-non-primeable-wire': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-missing-resource-cannot-prime-wire-adapter': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-config-property-uses-imported-artifact-from-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-wire-adapter-of-resource-cannot-be-primed': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-unsupported-member-variable-in-member-expression': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-multiple-template-files': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-assignment-expression-for-external-components': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-tagged-template-expression-contains-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-expression-contains-module-level-variable-ref': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-call-expression-references-unsupported-namespace': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-eval-usage': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-reference-to-class-functions': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-reference-to-module-functions': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-functions-declared-within-getter-method': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-non-existent-member-variable': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-unsupported-namespace-reference': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-contains-non-portable-identifier': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-super-class': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-member-expression-reference-to-unsupported-global': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-getter-property': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-property-from-unresolvable-wire': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-property-non-public': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-composition-on-unanalyzable-property-missing': 'warn', | ||
'@salesforce/lwc-graph-analyzer/no-render-function-contains-more-than-return-statement': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-render-function-return-statement-not-returning-imported-template': | ||
'warn', | ||
'@salesforce/lwc-graph-analyzer/no-render-function-return-statement': 'warn' | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint-plugin-node
is a project that has apparently fallen by the wayside. So the ESLint community forked it and went witheslint-plugin-n
. This project, by contrast, gets a goodly amount of attention.