2021-11-26 11:32:16 +08:00
|
|
|
|
{
|
|
|
|
|
"extends": [
|
|
|
|
|
"plugin:@typescript-eslint/recommended",
|
|
|
|
|
"eslint-config-airbnb-base",
|
2022-07-27 15:35:57 +08:00
|
|
|
|
"@vue/typescript/recommended",
|
2021-11-26 11:32:16 +08:00
|
|
|
|
"plugin:vue/vue3-recommended",
|
2022-04-30 23:16:41 +08:00
|
|
|
|
"plugin:vue-scoped-css/base",
|
2021-11-26 11:32:16 +08:00
|
|
|
|
"plugin:prettier/recommended"
|
|
|
|
|
],
|
|
|
|
|
"env": {
|
|
|
|
|
"browser": true,
|
|
|
|
|
"node": true,
|
|
|
|
|
"jest": true,
|
|
|
|
|
"es6": true
|
|
|
|
|
},
|
2022-02-16 20:22:02 +08:00
|
|
|
|
"globals": {
|
|
|
|
|
"defineProps": "readonly",
|
|
|
|
|
"defineEmits": "readonly"
|
|
|
|
|
},
|
2023-07-29 15:33:56 +08:00
|
|
|
|
"plugins": ["vue", "@typescript-eslint","import"],
|
2021-11-26 11:32:16 +08:00
|
|
|
|
"parserOptions": {
|
|
|
|
|
"parser": "@typescript-eslint/parser",
|
|
|
|
|
"sourceType": "module",
|
|
|
|
|
"allowImportExportEverywhere": true,
|
|
|
|
|
"ecmaFeatures": {
|
|
|
|
|
"jsx": true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"settings": {
|
2022-03-24 01:37:51 +08:00
|
|
|
|
"import/extensions": [".js", ".jsx", ".ts", ".tsx"]
|
2021-11-26 11:32:16 +08:00
|
|
|
|
},
|
|
|
|
|
"rules": {
|
2021-11-27 18:50:07 +08:00
|
|
|
|
"no-console": "off",
|
2021-11-26 11:32:16 +08:00
|
|
|
|
"no-continue": "off",
|
|
|
|
|
"no-restricted-syntax": "off",
|
2021-11-27 18:50:07 +08:00
|
|
|
|
"no-plusplus": "off",
|
2022-03-24 01:37:51 +08:00
|
|
|
|
"no-param-reassign": "off",
|
|
|
|
|
"no-shadow": "off",
|
2021-11-26 11:32:16 +08:00
|
|
|
|
"guard-for-in": "off",
|
2021-11-27 18:50:07 +08:00
|
|
|
|
|
2023-07-29 15:33:56 +08:00
|
|
|
|
"import/order": "error",
|
2021-11-27 18:50:07 +08:00
|
|
|
|
"import/extensions": "off",
|
|
|
|
|
"import/no-unresolved": "off",
|
2021-11-26 11:32:16 +08:00
|
|
|
|
"import/no-extraneous-dependencies": "off",
|
|
|
|
|
"import/prefer-default-export": "off",
|
2022-03-24 01:37:51 +08:00
|
|
|
|
"import/first": "off", // https://github.com/vuejs/vue-eslint-parser/issues/58
|
2021-11-27 18:50:07 +08:00
|
|
|
|
"@typescript-eslint/no-explicit-any": "off",
|
2021-12-10 03:05:49 +08:00
|
|
|
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
2022-06-22 19:14:28 +08:00
|
|
|
|
"vue/first-attribute-linebreak": 0,
|
|
|
|
|
|
|
|
|
|
"@typescript-eslint/no-unused-vars": [
|
|
|
|
|
"error",
|
|
|
|
|
{
|
|
|
|
|
"argsIgnorePattern": "^_",
|
|
|
|
|
"varsIgnorePattern": "^_"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"no-unused-vars": [
|
|
|
|
|
"error",
|
|
|
|
|
{
|
|
|
|
|
"argsIgnorePattern": "^_",
|
|
|
|
|
"varsIgnorePattern": "^_"
|
|
|
|
|
}
|
|
|
|
|
],
|
2022-06-24 16:57:15 +08:00
|
|
|
|
"no-use-before-define": "off",
|
|
|
|
|
"@typescript-eslint/no-use-before-define": "off",
|
2022-06-22 19:14:28 +08:00
|
|
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
2022-06-24 16:57:15 +08:00
|
|
|
|
"@typescript-eslint/ban-types": "off",
|
2023-04-05 15:40:41 +08:00
|
|
|
|
"class-methods-use-this": "off", // 因为AxiosCancel必须实例化而能静态化所以加的规则,如果有办法解决可以取消
|
2021-12-10 03:05:49 +08:00
|
|
|
|
},
|
|
|
|
|
"overrides": [
|
|
|
|
|
{
|
|
|
|
|
"files": ["*.vue"],
|
|
|
|
|
"rules": {
|
|
|
|
|
"vue/component-name-in-template-casing": [2, "kebab-case"],
|
|
|
|
|
"vue/require-default-prop": 0,
|
|
|
|
|
"vue/multi-word-component-names": 0,
|
|
|
|
|
"vue/no-reserved-props": 0,
|
2022-04-30 23:16:41 +08:00
|
|
|
|
"vue/no-v-html": 0,
|
|
|
|
|
"vue-scoped-css/enforce-style-type": ["error", { "allows": ["scoped"] }]
|
2021-12-10 03:05:49 +08:00
|
|
|
|
}
|
2022-06-22 19:14:28 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"files": ["*.ts", "*.tsx"], // https://github.com/typescript-eslint eslint-recommended
|
|
|
|
|
"rules": {
|
|
|
|
|
"constructor-super": "off", // ts(2335) & ts(2377)
|
|
|
|
|
"getter-return": "off", // ts(2378)
|
|
|
|
|
"no-const-assign": "off", // ts(2588)
|
|
|
|
|
"no-dupe-args": "off", // ts(2300)
|
|
|
|
|
"no-dupe-class-members": "off", // ts(2393) & ts(2300)
|
|
|
|
|
"no-dupe-keys": "off", // ts(1117)
|
|
|
|
|
"no-func-assign": "off", // ts(2539)
|
|
|
|
|
"no-import-assign": "off", // ts(2539) & ts(2540)
|
|
|
|
|
"no-new-symbol": "off", // ts(2588)
|
|
|
|
|
"no-obj-calls": "off", // ts(2349)
|
|
|
|
|
"no-redeclare": "off", // ts(2451)
|
|
|
|
|
"no-setter-return": "off", // ts(2408)
|
|
|
|
|
"no-this-before-super": "off", // ts(2376)
|
|
|
|
|
"no-undef": "off", // ts(2304)
|
|
|
|
|
"no-unreachable": "off", // ts(7027)
|
|
|
|
|
"no-unsafe-negation": "off", // ts(2365) & ts(2360) & ts(2358)
|
|
|
|
|
"no-var": "error", // ts transpiles let/const to var, so no need for vars any more
|
|
|
|
|
"prefer-const": "error", // ts provides better types with const
|
|
|
|
|
"prefer-rest-params": "error", // ts provides better types with rest args over arguments
|
|
|
|
|
"prefer-spread": "error", // ts transpiles spread to apply, so no need for manual apply
|
|
|
|
|
"valid-typeof": "off" // ts(2367)
|
|
|
|
|
}
|
2021-12-10 03:05:49 +08:00
|
|
|
|
}
|
|
|
|
|
]
|
2022-03-24 01:37:51 +08:00
|
|
|
|
}
|