diff options
author | Alexandre Alapetite <alexandre@alapetite.fr> | 2024-08-04 19:40:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-04 19:40:14 +0200 |
commit | b6f7c31e4c03e1f5d9974c39550708844f479942 (patch) | |
tree | b2715b49b42cede28ff6921dbb36ff24f1ad4dfb /eslint.config.js | |
parent | e269418a46ab1bd3713375de5cc109a35869efea (diff) | |
download | freshrss-b6f7c31e4c03e1f5d9974c39550708844f479942.tar.gz freshrss-b6f7c31e4c03e1f5d9974c39550708844f479942.zip |
Migrate to ESLint 9 (#6685)
* Migrate to ESLint 9
* https://eslint.org/docs/latest/use/migrate-to-9.0.0
* https://eslint.style/guide/migration
* https://github.com/neostandard/neostandard/ (https://github.com/standard/standard/issues/1948)
fix broken Dependabot PRs such as https://github.com/FreshRSS/FreshRSS/pull/6680
* comma-dangle rule is already included
* Use more standard filename
* More flexible syntax globals
* resolveIgnoresFromGitignore
* Dependabog update
* Relax object-shorthand
* GitHub action node-version
* GitHub action node-version again
* object-shorthand: off
* node >=18 due to dependencies
Diffstat (limited to 'eslint.config.js')
-rw-r--r-- | eslint.config.js | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..c65f7520c --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,55 @@ +import globals from "globals"; +import js from "@eslint/js"; +import neostandard, { resolveIgnoresFromGitignore } from 'neostandard'; +import stylistic from '@stylistic/eslint-plugin'; + +export default [ + { + files: ["**/*.js"], + languageOptions: { + globals: { + ...globals.browser, + }, + sourceType: "script", + }, + }, + { + ignores: [ + ...resolveIgnoresFromGitignore(), + "**/*.min.js", + "extensions/", + "p/scripts/vendor/", + ], + }, + js.configs.recommended, + // stylistic.configs['recommended-flat'], + ...neostandard(), + { + plugins: { + "@stylistic": stylistic, + }, + rules: { + "camelcase": "off", + "eqeqeq": "off", + "no-empty": ["error", { "allowEmptyCatch": true }], + "no-unused-vars": ["error", { + "args": "none", + "caughtErrors": "none", + }], + "object-shorthand": "off", + "yoda": "off", + "@stylistic/indent": ["warn", "tab", { "SwitchCase": 1 }], + "@stylistic/linebreak-style": ["error", "unix"], + "@stylistic/max-len": ["warn", 165], + "@stylistic/no-tabs": "off", + "@stylistic/quotes": ["off", "single", { "avoidEscape": true }], + "@stylistic/quote-props": ["warn", "consistent"], + "@stylistic/semi": ["warn", "always"], + "@stylistic/space-before-function-paren": ["warn", { + "anonymous": "always", + "asyncArrow": "always", + "named": "never", + }], + }, + }, +]; |