Skip to content

Commit

Permalink
Migrate to flatconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Nov 18, 2024
1 parent 4d762a7 commit 1bd70cf
Show file tree
Hide file tree
Showing 6 changed files with 1,585 additions and 2,746 deletions.
5 changes: 0 additions & 5 deletions webextensions/.eslintignore

This file was deleted.

51 changes: 0 additions & 51 deletions webextensions/.eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion webextensions/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ install_dependency:
[ -e "$(NPM_BIN_DIR)/eslint" -a -e "$(NPM_BIN_DIR)/jsonlint-cli" ] || npm install

lint: install_dependency
"$(NPM_BIN_DIR)/eslint" . --ext=.js --report-unused-disable-directives
"$(NPM_BIN_DIR)/eslint" . --report-unused-disable-directives
find . -type d -name node_modules -prune -o -type f -name '*.json' -print | xargs "$(NPM_BIN_DIR)/jsonlint-cli"

format: install_dependency
Expand Down
52 changes: 52 additions & 0 deletions webextensions/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import globals from "globals";

export default [{
ignores: ["eslint.config.mjs", "extlib/*", "!**/.eslintrc.js"],
}, {
languageOptions: {
globals: {
...globals.browser,
...globals.webextensions,
},

ecmaVersion: 2022,
sourceType: "script",
},

settings: {
"import/resolver": {
"babel-module": {
root: ["./"],
},
},
},

rules: {
"no-const-assign": "error",

"prefer-const": ["warn", {
destructuring: "any",
ignoreReadBeforeAssign: false,
}],

indent: ["warn", 2, {
SwitchCase: 1,
MemberExpression: 1,

CallExpression: {
arguments: "first",
},

VariableDeclarator: {
var: 2,
let: 2,
const: 3,
},
}],

quotes: ["warn", "single", {
avoidEscape: true,
allowTemplateLiterals: true,
}],
},
}];
Loading

0 comments on commit 1bd70cf

Please sign in to comment.