mirror of
https://github.com/HorlogeSkynet/thunderbird-user.js.git
synced 2025-02-22 23:11:17 +01:00
Migrates ESLint configuration to new (9+) "flat format"
This commit is contained in:
parent
7390a8056c
commit
ee7649a8b4
36
.eslint.config.mjs
Normal file
36
.eslint.config.mjs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// Thunderbird User.JS ESLint configuration file
|
||||||
|
|
||||||
|
import js from "@eslint/js";
|
||||||
|
|
||||||
|
export default [
|
||||||
|
js.configs.recommended,
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
// Expect only double-quoted strings.
|
||||||
|
quotes: ["error", "double"],
|
||||||
|
|
||||||
|
// Expect a semicolon after each statement.
|
||||||
|
semi: ["error", "always", {"omitLastInOneLineBlock": false}],
|
||||||
|
|
||||||
|
// As project code style, don't allow tabulation nor trailing whitespaces.
|
||||||
|
"no-tabs": "error",
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
|
||||||
|
// Don't allow whitespace before semicolons.
|
||||||
|
"semi-spacing": ["error", {"before": false}],
|
||||||
|
|
||||||
|
// Don't allow irregular whitespace characters in our sheet.
|
||||||
|
"no-irregular-whitespace": ["error", {"skipStrings": false, "skipComments": false}],
|
||||||
|
},
|
||||||
|
languageOptions: {
|
||||||
|
// From <https://searchfox.org/mozilla-central/rev/c938c7416c633639a5c8ce4412be586eefb48005/modules/libpref/parser/src/lib.rs#296>
|
||||||
|
globals: {
|
||||||
|
pref: "readonly",
|
||||||
|
user_pref: "readonly",
|
||||||
|
sticky: "readonly",
|
||||||
|
locked: "readonly",
|
||||||
|
sticky_pref: "readonly",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
@ -1,45 +0,0 @@
|
|||||||
%YAML 1.2
|
|
||||||
---
|
|
||||||
|
|
||||||
root: true
|
|
||||||
|
|
||||||
extends: 'eslint:recommended'
|
|
||||||
|
|
||||||
globals:
|
|
||||||
# From <https://searchfox.org/mozilla-central/rev/c938c7416c633639a5c8ce4412be586eefb48005/modules/libpref/parser/src/lib.rs#296>
|
|
||||||
pref: true
|
|
||||||
user_pref: true
|
|
||||||
sticky: true
|
|
||||||
locked: true
|
|
||||||
sticky_pref: true
|
|
||||||
|
|
||||||
rules:
|
|
||||||
# Expect a semicolon after each statement.
|
|
||||||
semi:
|
|
||||||
- "error"
|
|
||||||
- "always"
|
|
||||||
-
|
|
||||||
omitLastInOneLineBlock: false
|
|
||||||
|
|
||||||
# As internal code style, don't allow tabulation.
|
|
||||||
no-tabs: "error"
|
|
||||||
# ... nor trailing spaces !
|
|
||||||
no-trailing-spaces: "error"
|
|
||||||
|
|
||||||
# Expect only double-quoted strings.
|
|
||||||
quotes:
|
|
||||||
- "error"
|
|
||||||
- "double"
|
|
||||||
|
|
||||||
# Don't allow whitespace before semicolons.
|
|
||||||
semi-spacing:
|
|
||||||
- "error"
|
|
||||||
-
|
|
||||||
before: false
|
|
||||||
|
|
||||||
# Don't allow irregular whitespace characters in our sheet.
|
|
||||||
no-irregular-whitespace:
|
|
||||||
- "error"
|
|
||||||
-
|
|
||||||
skipStrings: false
|
|
||||||
skipComments: false
|
|
6
.github/workflows/linting.yml
vendored
6
.github/workflows/linting.yml
vendored
@ -7,13 +7,11 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Run ESLint on user.js
|
name: Run ESLint on user.js
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
|
||||||
ESLINT_USE_FLAT_CONFIG: false
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
|
|
||||||
- run: npm install -g eslint
|
- run: npm install eslint @eslint/js
|
||||||
- run: eslint user.js
|
- run: npx eslint -c .eslint.config.mjs user.js
|
||||||
|
Loading…
Reference in New Issue
Block a user