Skip to content

Commit 3c7b518

Browse files
committed
Added ESLint as dev dependency
1 parent bbfd39e commit 3c7b518

File tree

5 files changed

+1026
-0
lines changed

5 files changed

+1026
-0
lines changed

.github/workflows/eslint.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: ESLint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
eslint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
10+
- name: Checkout repository code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 21
17+
18+
- name: Install dependencies
19+
run: npm ci # instead of install to ensure consistency and determinism in CI/CD workflow
20+
21+
- name: Run ESLint
22+
run: npm run lint

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.eslintcache

eslint.config.mjs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import js from '@eslint/js';
2+
3+
export default [
4+
js.configs.recommended,
5+
{
6+
rules: {
7+
'indent': 'off', 'no-unexpected-multiline': 'off', 'key-spacing': 'off', // allow whitespace anywhere
8+
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }], // enforce single quotes except backticks to avoid escaping quotes
9+
'comma-dangle': ['error', 'never'], // enforce no trailing commas in arrays or objects
10+
'no-async-promise-executor': 'off', // allow promise executor functions to be async (to accomodate await lines)
11+
'no-constant-condition': 'off', // allow constant conditions
12+
'no-empty': 'off', // allow empty blocks
13+
'no-inner-declarations': 'off', // allow function declarations anywhere
14+
'no-useless-escape': 'off', // allow all escape chars cause ESLint sucks at detecting truly useless ones
15+
'no-unused-vars': ['error', { 'caughtErrors': 'none' }] // allow unused named args in catch blocks
16+
},
17+
languageOptions: { ecmaVersion: 2022, sourceType: 'script', globals: { chrome: 'readonly' }}
18+
},
19+
{ files: ['**/*.mjs'], languageOptions: { sourceType: 'module' }}
20+
];

0 commit comments

Comments
 (0)