Skip to content

Commit 55c9040

Browse files
committed
build: upgraded to ESLint v9
1 parent fd6db7d commit 55c9040

File tree

8 files changed

+52
-28
lines changed

8 files changed

+52
-28
lines changed

eslint.config.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
'use strict';
2+
3+
const { defineConfig } = require('eslint/config');
4+
const eslintJs = require('@eslint/js');
5+
const jestPlugin = require('eslint-plugin-jest');
6+
const salesforceLwcConfig = require('@salesforce/eslint-config-lwc/recommended');
7+
const globals = require('globals');
8+
9+
module.exports = defineConfig([
10+
// LWC configuration
11+
{
12+
files: ['src*/main/default/lwc/**/*.js'],
13+
extends: [salesforceLwcConfig]
14+
},
15+
16+
// LWC configuration with override for LWC test files
17+
{
18+
files: ['src-*/main/default/lwc/**/*.test.js'],
19+
extends: [salesforceLwcConfig],
20+
rules: {
21+
'@lwc/lwc/no-unexpected-wire-adapter-usages': 'off'
22+
},
23+
languageOptions: {
24+
globals: {
25+
...globals.node
26+
}
27+
}
28+
},
29+
30+
// Jest mocks configuration
31+
{
32+
files: ['src*/test/jest-mocks/**/*.js'],
33+
languageOptions: {
34+
sourceType: 'module',
35+
ecmaVersion: 'latest',
36+
globals: {
37+
...globals.node,
38+
...globals.es2021,
39+
...jestPlugin.environments.globals.globals
40+
}
41+
},
42+
plugins: {
43+
eslintJs
44+
},
45+
extends: ['eslintJs/recommended']
46+
}
47+
]);

src-sample/main/default/lwc/.eslintrc.json

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

src-sample/main/default/lwc/sampleLookupContainer/sampleLookupContainer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export default class SampleLookupContainer extends LightningElement {
6666
lookupElement.setSearchResults(results);
6767
} catch (error) {
6868
this.notifyUser('Lookup Error', 'An error occurred while searching with the lookup field.', 'error');
69-
// eslint-disable-next-line no-console
7069
console.error('Lookup error', JSON.stringify(error));
7170
this.errors = [error];
7271
}

src/main/default/lwc/.eslintrc.json

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

src/main/default/lwc/lookup/__tests__/lookupEventFiring.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { createLookupElement, inputSearchTerm, SAMPLE_SEARCH_ITEMS } = require('./lookupTest.utils');
1+
import { createLookupElement, inputSearchTerm, SAMPLE_SEARCH_ITEMS } from './lookupTest.utils';
22

33
const SAMPLE_SEARCH_TOO_SHORT_WHITESPACE = 'A ';
44
const SAMPLE_SEARCH_TOO_SHORT_SPECIAL = 'a*';

src/main/default/lwc/lookup/__tests__/lookupEventHandling.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { createLookupElement, inputSearchTerm, flushPromises, SAMPLE_SEARCH_ITEMS } = require('./lookupTest.utils');
1+
import { createLookupElement, inputSearchTerm, flushPromises, SAMPLE_SEARCH_ITEMS } from './lookupTest.utils';
22
import { getNavigateCalledWith } from 'lightning/navigation';
33

44
const SAMPLE_SEARCH = 'sample';

src/main/default/lwc/lookup/__tests__/lookupExposedFunctions.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { createLookupElement, inputSearchTerm, flushPromises, SAMPLE_SEARCH_ITEMS } = require('./lookupTest.utils');
1+
import { createLookupElement, inputSearchTerm, flushPromises, SAMPLE_SEARCH_ITEMS } from './lookupTest.utils';
22

33
describe('c-lookup exposed functions', () => {
44
afterEach(() => {

src/main/default/lwc/lookup/__tests__/lookupRendering.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const {
1+
import {
22
createLookupElement,
33
flushPromises,
44
inputSearchTerm,
55
SAMPLE_SEARCH_ITEMS,
66
LABEL_NO_RESULTS
7-
} = require('./lookupTest.utils');
7+
} from './lookupTest.utils';
88

99
describe('c-lookup rendering', () => {
1010
afterEach(() => {

0 commit comments

Comments
 (0)