Skip to content

Commit 981a313

Browse files
committed
Updating project linting to ESLint 9
1 parent 3b187f6 commit 981a313

File tree

103 files changed

+474
-367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+474
-367
lines changed

.eslintrc

Lines changed: 0 additions & 28 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yarn format && yarn lint && yarn test

eslint.config.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) 2025, salesforce.com, inc.
3+
* All rights reserved.
4+
* SPDX-License-Identifier: MIT
5+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6+
*/
7+
8+
const js = require('@eslint/js');
9+
const nodePlugin = require('eslint-plugin-n');
10+
const eslintPlugin = require('eslint-plugin-eslint-plugin');
11+
const tseslint = require('typescript-eslint');
12+
13+
module.exports = [
14+
{
15+
ignores: ['test/**/test.js', 'reports/**']
16+
},
17+
{
18+
...js.configs.recommended,
19+
...nodePlugin.configs['flat/recommended-script'],
20+
files: ['**/*.js'],
21+
languageOptions: {
22+
ecmaVersion: 'latest',
23+
sourceType: 'module',
24+
globals: {
25+
// jest globals
26+
jest: 'readonly',
27+
describe: 'readonly',
28+
it: 'readonly',
29+
expect: 'readonly',
30+
beforeEach: 'readonly',
31+
afterEach: 'readonly',
32+
beforeAll: 'readonly',
33+
afterAll: 'readonly'
34+
}
35+
},
36+
rules: {
37+
strict: ['error', 'global']
38+
}
39+
},
40+
...tseslint.configs.recommended.map((config) => ({
41+
...config,
42+
files: ['**/*.d.ts']
43+
})),
44+
{
45+
files: ['lib/rules/*.js'],
46+
plugins: {
47+
'eslint-plugin': eslintPlugin
48+
},
49+
...eslintPlugin.configs['flat/recommended'],
50+
rules: {
51+
'eslint-plugin/prefer-message-ids': 'off' // Messages come straight from Komaci.
52+
}
53+
}
54+
];

index.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

jest.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77

8-
'use strict';
9-
108
module.exports = {
119
displayName: 'Unit Tests',
1210
setupFilesAfterEnv: ['jest-extended', 'jest-chain'],

lib/configs/base-legacy.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77

8-
'use strict';
9-
108
module.exports = {
119
plugins: ['@salesforce/lwc-graph-analyzer'],
1210
parser: '@babel/eslint-parser',

lib/configs/base.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77

8-
'use strict';
9-
108
const bundleAnalyzer = require('../processor');
119

1210
module.exports = {

lib/configs/recommended-legacy.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77

8-
'use strict';
9-
108
module.exports = {
119
extends: ['./configs/base-legacy'],
1210
rules: {},

lib/configs/recommended.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77

8-
'use strict';
9-
108
const baseConfig = require('./base');
119

1210
module.exports = {

lib/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
66
*/
77

8-
'use strict';
9-
108
const bundleAnalyzer = require('./processor');
119
const LwcBundle = require('./lwc-bundle');
1210
const allRules = require('./rules');

0 commit comments

Comments
 (0)