mirror of
https://github.com/searxng/searxng.git
synced 2024-11-22 12:10:11 +01:00
[fix] eslint: migrate JSON config to flat-config (.eslintrc.json -> eslint.config.js)
In ESLint v9.0.0, ``eslint.config.js`` is the new default configuration format. The previous format, ``eslintrc``, is now deprecated and will not automatically be searched for. [1] This migration was done with the help of the "Configuration Migration Guide" [2] [1] https://eslint.org/docs/latest/use/migrate-to-9.0.0#flat-config [2] https://eslint.org/docs/latest/use/configure/migration-guide Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
d58c40522b
commit
766823a64b
@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"es2021": true,
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"extends": "eslint:recommended",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 12
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"indent": ["error", 2],
|
|
||||||
"keyword-spacing": ["error", { "before": true, "after": true }],
|
|
||||||
"no-trailing-spaces": 2,
|
|
||||||
"space-before-function-paren": ["error", "always"],
|
|
||||||
"space-infix-ops": "error",
|
|
||||||
"comma-spacing": ["error", { "before": false, "after": true }],
|
|
||||||
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
|
|
||||||
"curly": ["error", "multi-line"],
|
|
||||||
"block-spacing": ["error", "always"],
|
|
||||||
"dot-location": ["error", "property"],
|
|
||||||
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
|
|
||||||
"spaced-comment": ["error", "always", {
|
|
||||||
"line": { "markers": ["*package", "!", "/", ",", "="] },
|
|
||||||
"block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
26
searx/static/themes/simple/eslint.config.js
Normal file
26
searx/static/themes/simple/eslint.config.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
module.exports = [
|
||||||
|
{
|
||||||
|
"rules": {
|
||||||
|
"indent": ["error", 2],
|
||||||
|
"keyword-spacing": ["error", { "before": true, "after": true }],
|
||||||
|
"no-trailing-spaces": 2,
|
||||||
|
"space-before-function-paren": ["error", "always"],
|
||||||
|
"space-infix-ops": "error",
|
||||||
|
"comma-spacing": ["error", { "before": false, "after": true }],
|
||||||
|
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
|
||||||
|
"curly": ["error", "multi-line"],
|
||||||
|
"block-spacing": ["error", "always"],
|
||||||
|
"dot-location": ["error", "property"],
|
||||||
|
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
|
||||||
|
"spaced-comment": [
|
||||||
|
"error", "always", {
|
||||||
|
"line": { "markers": ["*package", "!", "/", ",", "="] },
|
||||||
|
"block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 12
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
@ -35,7 +35,7 @@ module.exports = function (grunt) {
|
|||||||
},
|
},
|
||||||
eslint: {
|
eslint: {
|
||||||
options: {
|
options: {
|
||||||
overrideConfigFile: '.eslintrc.json',
|
overrideConfigFile: 'eslint.config.js',
|
||||||
failOnError: true,
|
failOnError: true,
|
||||||
fix: grunt.option('fix')
|
fix: grunt.option('fix')
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user