-
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.
Start using pre-commit and update eslint
- Loading branch information
Showing
7 changed files
with
136 additions
and
91 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
Build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/action@v3.0.0 |
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,26 @@ | ||
repos: | ||
|
||
- repo: local | ||
hooks: | ||
|
||
- id: eslint | ||
name: eslint | ||
entry: eslint | ||
language: node | ||
types_or: | ||
- javascript | ||
additional_dependencies: | ||
- "@eslint/js@8.54.0" | ||
- "@stylistic/eslint-plugin-js@1.4.0" | ||
- eslint@8.54.0 | ||
- globals@13.23.0 | ||
|
||
- id: web-ext lint | ||
name: web-ext lint | ||
entry: web-ext lint | ||
language: node | ||
types_or: | ||
- javascript | ||
pass_filenames: false | ||
additional_dependencies: | ||
- web-ext@7.8.0 |
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,88 @@ | ||
const globals = require("globals"); | ||
const js = require("@eslint/js"); | ||
const stylistic = require("@stylistic/eslint-plugin-js"); | ||
|
||
module.exports = [ | ||
{ | ||
ignores: [ | ||
"base64.js", | ||
"browser-polyfill.js", | ||
], | ||
languageOptions: { | ||
globals: { | ||
...globals.browser, | ||
...globals.commonjs, | ||
...globals.es6, | ||
...globals.jquery, | ||
...globals.webextensions, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2020, | ||
}, | ||
}, | ||
plugins: { | ||
stylistic: stylistic, | ||
}, | ||
rules:{ | ||
...js.configs.recommended.rules, | ||
"no-restricted-syntax": [ | ||
"error", | ||
"ForInStatement", | ||
], | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"args": "all", | ||
"argsIgnorePattern": "^_[^_]", | ||
"varsIgnorePattern": "^_[^_]", | ||
}, | ||
], | ||
"no-var": "error", | ||
"prefer-const": "error", | ||
"stylistic/array-bracket-newline": [ | ||
"error", | ||
"consistent", | ||
], | ||
"stylistic/array-bracket-spacing": [ | ||
"error", | ||
"never", | ||
], | ||
"stylistic/comma-dangle": [ | ||
"error", | ||
{ | ||
"arrays": "always-multiline", | ||
"exports": "always-multiline", | ||
"functions": "only-multiline", | ||
"imports": "always-multiline", | ||
"objects": "always-multiline", | ||
}, | ||
], | ||
"stylistic/indent": [ | ||
"error", | ||
4, | ||
{ | ||
"SwitchCase": 1, | ||
}, | ||
], | ||
"stylistic/linebreak-style": [ | ||
"error", | ||
"unix", | ||
], | ||
"stylistic/no-console": [ | ||
"off", | ||
], | ||
"stylistic/object-curly-spacing": [ | ||
"error", | ||
"never", | ||
], | ||
"stylistic/quotes": [ | ||
"error", | ||
"double", | ||
], | ||
"stylistic/semi": [ | ||
"error", | ||
"always", | ||
], | ||
}, | ||
}, | ||
]; |
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