-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
1,026 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: ESLint | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout repository code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 21 | ||
|
||
- name: Install dependencies | ||
run: npm ci # instead of install to ensure consistency and determinism in CI/CD workflow | ||
|
||
- name: Run ESLint | ||
run: npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
.eslintcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import js from '@eslint/js'; | ||
|
||
export default [ | ||
js.configs.recommended, | ||
{ | ||
rules: { | ||
'indent': 'off', 'no-unexpected-multiline': 'off', 'key-spacing': 'off', // allow whitespace anywhere | ||
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }], // enforce single quotes except backticks to avoid escaping quotes | ||
'comma-dangle': ['error', 'never'], // enforce no trailing commas in arrays or objects | ||
'no-async-promise-executor': 'off', // allow promise executor functions to be async (to accomodate await lines) | ||
'no-constant-condition': 'off', // allow constant conditions | ||
'no-empty': 'off', // allow empty blocks | ||
'no-inner-declarations': 'off', // allow function declarations anywhere | ||
'no-useless-escape': 'off', // allow all escape chars cause ESLint sucks at detecting truly useless ones | ||
'no-unused-vars': ['error', { 'caughtErrors': 'none' }] // allow unused named args in catch blocks | ||
}, | ||
languageOptions: { ecmaVersion: 2022, sourceType: 'script', globals: { chrome: 'readonly' }} | ||
}, | ||
{ files: ['**/*.mjs'], languageOptions: { sourceType: 'module' }} | ||
]; |
Oops, something went wrong.