Skip to content

Commit a36371f

Browse files
authored
chore: upgrade to ESLint v9 (#1024)
* chore: upgrade to ESLint v9 * chore: prettier update
1 parent 2122a04 commit a36371f

File tree

9 files changed

+2092
-4734
lines changed

9 files changed

+2092
-4734
lines changed

CODE_OF_CONDUCT.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ socioeconomic status, or other similar personal characteristics.
3535
Examples of behavior that contributes to creating a positive environment
3636
include:
3737

38-
- Using welcoming and inclusive language
39-
- Being respectful of differing viewpoints and experiences
40-
- Gracefully accepting constructive criticism
41-
- Focusing on what is best for the community
42-
- Showing empathy toward other community members
38+
- Using welcoming and inclusive language
39+
- Being respectful of differing viewpoints and experiences
40+
- Gracefully accepting constructive criticism
41+
- Focusing on what is best for the community
42+
- Showing empathy toward other community members
4343

4444
Examples of unacceptable behavior by participants include:
4545

46-
- The use of sexualized language or imagery and unwelcome sexual attention or
47-
advances
48-
- Personal attacks, insulting/derogatory comments, or trolling
49-
- Public or private harassment
50-
- Publishing, or threatening to publish, others' private information—such as
51-
a physical or electronic address—without explicit permission
52-
- Other conduct which could reasonably be considered inappropriate in a
53-
professional setting
54-
- Advocating for or encouraging any of the above behaviors
46+
- The use of sexualized language or imagery and unwelcome sexual attention or
47+
advances
48+
- Personal attacks, insulting/derogatory comments, or trolling
49+
- Public or private harassment
50+
- Publishing, or threatening to publish, others' private information—such as
51+
a physical or electronic address—without explicit permission
52+
- Other conduct which could reasonably be considered inappropriate in a
53+
professional setting
54+
- Advocating for or encouraging any of the above behaviors
5555

5656
## Our Responsibilities
5757

CONTRIBUTION.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ Agreement. You can do so by going to https://cla.salesforce.com/sign-cla.
1919

2020
## Branches
2121

22-
- We work in `main`.
23-
- Our released (aka. _production_) branch is `main`.
24-
- Our work happens in _topic_ branches (feature and/or bug-fix).
25-
- feature as well as bug-fix branches are based on `main`
26-
- branches _should_ be kept up-to-date using `rebase`
27-
- see below for further merge instructions
22+
- We work in `main`.
23+
- Our released (aka. _production_) branch is `main`.
24+
- Our work happens in _topic_ branches (feature and/or bug-fix).
25+
- feature as well as bug-fix branches are based on `main`
26+
- branches _should_ be kept up-to-date using `rebase`
27+
- see below for further merge instructions
2828

2929
### Merging between branches
3030

31-
- We try to limit merge commits as much as possible.
31+
- We try to limit merge commits as much as possible.
3232

33-
- _Topic_ branches are:
33+
- _Topic_ branches are:
3434

3535
1. based on `main` and will be
3636
1. squash-merged into `main`.
3737

3838
## Pull Requests
3939

40-
- Develop features and bug fixes in _topic_ branches.
41-
- _Topic_ branches can live in forks (external contributors) or within this repository (committers).
42-
\*\* When creating _topic_ branches in this repository please prefix with `<developer-name>/`.
40+
- Develop features and bug fixes in _topic_ branches.
41+
- _Topic_ branches can live in forks (external contributors) or within this repository (committers).
42+
\*\* When creating _topic_ branches in this repository please prefix with `<developer-name>/`.
4343

4444
### Merging Pull Requests
4545

46-
- Pull request merging is restricted to squash & merge only.
46+
- Pull request merging is restricted to squash & merge only.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ A collection of easy-to-digest code examples for Lightning Web Components. Each
1818
1919
## Table of contents
2020

21-
- [Installing the app using a Scratch Org](#installing-the-app-using-a-scratch-org): This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code.
21+
- [Installing the app using a Scratch Org](#installing-the-app-using-a-scratch-org): This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code.
2222

23-
- [Installing the app using an Unlocked Package](#installing-the-app-using-an-unlocked-package): This option allows anybody to experience the sample app without installing a local development environment.
23+
- [Installing the app using an Unlocked Package](#installing-the-app-using-an-unlocked-package): This option allows anybody to experience the sample app without installing a local development environment.
2424

25-
- [Installing the app using a Developer Edition Org or a Trailhead Playground](#installing-the-app-using-a-developer-edition-org-or-a-trailhead-playground): Useful when tackling Trailhead Badges or if you want the app deployed to a more permanent environment than a Scratch org.
25+
- [Installing the app using a Developer Edition Org or a Trailhead Playground](#installing-the-app-using-a-developer-edition-org-or-a-trailhead-playground): Useful when tackling Trailhead Badges or if you want the app deployed to a more permanent environment than a Scratch org.
2626

27-
- [Optional installation instructions](#optional-installation-instructions)
27+
- [Optional installation instructions](#optional-installation-instructions)
2828

29-
- [Code tours](#code-tours)
29+
- [Code tours](#code-tours)
3030

3131
## Installing the app using a Scratch Org
3232

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 for force-app/main/default/lwc
11+
{
12+
files: ['force-app/main/default/lwc/**/*.js'],
13+
extends: [salesforceLwcConfig]
14+
},
15+
16+
// LWC configuration with override for LWC test files
17+
{
18+
files: ['force-app/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: ['force-app/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+
]);

force-app/main/default/lwc/.eslintrc.json

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

force-app/main/default/lwc/libsFullCalendar/libsFullCalendar.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export default class LibsFullCalendar extends LightningElement {
3535

3636
initializeCalendar() {
3737
const calendarEl = this.template.querySelector('.calendar');
38-
// eslint-disable-next-line no-undef
3938
if (typeof FullCalendar === 'undefined') {
4039
throw new Error(
4140
'Could not load FullCalendar. Make sure that Lightning Web Security is enabled for your org. See link below.'

force-app/main/default/lwc/navToNewRecordWithDefaults/__tests__/navToNewRecordWithDefaults.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-unused-vars */
21
import { createElement } from 'lwc';
32
import NavToNewRecordWithDefaults from 'c/navToNewRecordWithDefaults';
43
import { getNavigateCalledWith } from 'lightning/navigation';

0 commit comments

Comments
 (0)