mirror of
https://github.com/edward-shen/MMM-pages.git
synced 2024-11-24 11:14:29 -08:00
Replace deprected eslint config
This commit is contained in:
parent
169175b400
commit
c290f92020
2 changed files with 56 additions and 14 deletions
|
@ -1,14 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "airbnb-base",
|
|
||||||
"globals": {
|
|
||||||
"Module": true,
|
|
||||||
"Log": true,
|
|
||||||
"MM": true
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"comma-dangle": "off",
|
|
||||||
"object-shorthand": "off",
|
|
||||||
"func-names": "off",
|
|
||||||
"space-before-function-paren": "off"
|
|
||||||
}
|
|
||||||
}
|
|
56
eslint.config.mjs
Normal file
56
eslint.config.mjs
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
import eslintPluginJs from "@eslint/js";
|
||||||
|
import eslintPluginStylistic from "@stylistic/eslint-plugin";
|
||||||
|
import globals from "globals";
|
||||||
|
|
||||||
|
const config = [
|
||||||
|
{
|
||||||
|
files: ["**/*.js", "**/*.mjs"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.node,
|
||||||
|
Log: "readonly",
|
||||||
|
MM: "readonly",
|
||||||
|
Module: "readonly",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
...eslintPluginStylistic.configs["all-flat"].plugins,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...eslintPluginJs.configs.all.rules,
|
||||||
|
...eslintPluginStylistic.configs["all-flat"].rules,
|
||||||
|
"@stylistic/array-element-newline": "off",
|
||||||
|
"@stylistic/brace-style": ["error", "1tbs", { allowSingleLine: true }],
|
||||||
|
"@stylistic/comma-dangle": ["error", "only-multiline"],
|
||||||
|
"@stylistic/dot-location": ["error", "property"],
|
||||||
|
"@stylistic/function-call-argument-newline": "off",
|
||||||
|
"@stylistic/indent": ["error", 2],
|
||||||
|
"@stylistic/max-statements-per-line": ["error", { max: 2 }],
|
||||||
|
"@stylistic/object-curly-spacing": "off",
|
||||||
|
"@stylistic/padded-blocks": "off",
|
||||||
|
"@stylistic/quote-props": ["error", "consistent-as-needed"],
|
||||||
|
"init-declarations": "off",
|
||||||
|
"@stylistic/quotes": ["error", "double"],
|
||||||
|
"@stylistic/multiline-comment-style": "off",
|
||||||
|
"@stylistic/multiline-ternary": "off",
|
||||||
|
"capitalized-comments": "off",
|
||||||
|
"consistent-this": "off",
|
||||||
|
"max-lines": "off",
|
||||||
|
"max-lines-per-function": "off",
|
||||||
|
"max-statements": "off",
|
||||||
|
"no-empty-function": "off",
|
||||||
|
"no-inline-comments": "off",
|
||||||
|
"no-magic-numbers": "off",
|
||||||
|
"no-negated-condition": "off",
|
||||||
|
"no-ternary": "off",
|
||||||
|
"no-undefined": "off",
|
||||||
|
"one-var": "off",
|
||||||
|
"sort-keys": "off",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
export default config;
|
Loading…
Reference in a new issue