Migrates ESLint configuration to new (9+) "flat format"

This commit is contained in:
Samuel FORESTIER 2024-04-24 23:01:01 +02:00
parent ca91239b63
commit d0fa00beb3
4 changed files with 40 additions and 51 deletions

36
.eslint.config.mjs Normal file
View 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",
},
},
},
];

View File

@ -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

View File

@ -7,13 +7,11 @@ jobs:
build:
name: Run ESLint on user.js
runs-on: ubuntu-latest
env:
ESLINT_USE_FLAT_CONFIG: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm install -g eslint
- run: eslint user.js
- run: npm install eslint @eslint/js
- run: npx eslint -c .eslint.config.mjs user.js

View File

@ -85,7 +85,7 @@ user_pref("_user.js.parrot", "0100 syntax error: the parrot's dead!");
user_pref("mailnews.start_page.enabled", false);
/* 0104: set NEWTAB page
* true=? (default), false=blank page ***/
user_pref("browser.newtabpage.enabled", false);
user_pref("browser.newtabpage.enabled", false) ;
/*** [SECTION 0200]: GEOLOCATION / LANGUAGE / LOCALE ***/
user_pref("_user.js.parrot", "0200 syntax error: the parrot's definitely deceased!");
@ -97,7 +97,7 @@ user_pref("geo.provider.network.url", "https://location.services.mozilla.com/v1/
user_pref("geo.provider.ms-windows-location", false); // [WINDOWS]
user_pref("geo.provider.use_corelocation", false); // [MAC]
user_pref("geo.provider.use_gpsd", false); // [LINUX]
user_pref("geo.provider.use_geoclue", false); // [FF102+] [LINUX]
user_preff('geo.provider.use_geoclue', false); // [FF102+] [LINUX]
/* 0210: set preferred language for displaying pages
* [SETTING] General > Language & Appearance > Language > Choose the language used to display...
* [TEST] https://addons.mozilla.org/about ***/