2021-07-10 04:38:42 +12:00
|
|
|
module.exports = {
|
|
|
|
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
|
|
|
|
// This option interrupts the configuration hierarchy at this file
|
|
|
|
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
|
|
|
|
root: true,
|
|
|
|
|
2023-08-19 20:43:21 +12:00
|
|
|
// https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
|
2021-07-10 04:38:42 +12:00
|
|
|
// Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
|
|
|
|
// `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
|
|
|
|
parserOptions: {
|
2023-09-04 06:36:10 +12:00
|
|
|
parser: require.resolve("@typescript-eslint/parser"),
|
|
|
|
extraFileExtensions: [".vue"],
|
2021-07-10 04:38:42 +12:00
|
|
|
},
|
|
|
|
|
|
|
|
env: {
|
2023-08-19 20:43:21 +12:00
|
|
|
browser: true,
|
|
|
|
es2021: true,
|
|
|
|
node: true,
|
2023-09-04 06:36:10 +12:00
|
|
|
"vue/setup-compiler-macros": true,
|
2021-07-10 04:38:42 +12:00
|
|
|
},
|
|
|
|
|
|
|
|
// Rules order is important, please avoid shuffling them
|
|
|
|
extends: [
|
|
|
|
// Base ESLint recommended rules
|
|
|
|
// 'eslint:recommended',
|
|
|
|
|
|
|
|
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#usage
|
|
|
|
// ESLint typescript rules
|
2023-09-04 06:36:10 +12:00
|
|
|
"plugin:@typescript-eslint/recommended",
|
2021-07-10 04:38:42 +12:00
|
|
|
|
|
|
|
// Uncomment any of the lines below to choose desired strictness,
|
|
|
|
// but leave only one uncommented!
|
|
|
|
// See https://eslint.vuejs.org/rules/#available-rules
|
2023-09-04 06:36:10 +12:00
|
|
|
"plugin:vue/vue3-essential", // Priority A: Essential (Error Prevention)
|
|
|
|
"plugin:vue/vue3-strongly-recommended", // Priority B: Strongly Recommended (Improving Readability)
|
|
|
|
"plugin:vue/vue3-recommended", // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
|
2021-07-10 04:38:42 +12:00
|
|
|
|
2023-09-04 06:36:10 +12:00
|
|
|
"standard",
|
2021-07-10 04:38:42 +12:00
|
|
|
],
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
// required to apply rules which need type information
|
2023-09-04 06:36:10 +12:00
|
|
|
"@typescript-eslint",
|
2021-07-10 04:38:42 +12:00
|
|
|
|
2023-08-19 20:43:21 +12:00
|
|
|
// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
|
2021-07-10 04:38:42 +12:00
|
|
|
// required to lint *.vue files
|
2023-09-04 06:36:10 +12:00
|
|
|
"vue",
|
2021-07-10 04:38:42 +12:00
|
|
|
],
|
|
|
|
|
|
|
|
globals: {
|
2023-09-04 06:36:10 +12:00
|
|
|
ga: "readonly", // Google Analytics
|
|
|
|
cordova: "readonly",
|
|
|
|
__statics: "readonly",
|
|
|
|
__QUASAR_SSR__: "readonly",
|
|
|
|
__QUASAR_SSR_SERVER__: "readonly",
|
|
|
|
__QUASAR_SSR_CLIENT__: "readonly",
|
|
|
|
__QUASAR_SSR_PWA__: "readonly",
|
|
|
|
process: "readonly",
|
|
|
|
Capacitor: "readonly",
|
|
|
|
chrome: "readonly",
|
2021-07-10 04:38:42 +12:00
|
|
|
},
|
|
|
|
|
|
|
|
// add your custom rules here
|
|
|
|
rules: {
|
|
|
|
// allow async-await
|
2023-09-04 06:36:10 +12:00
|
|
|
"generator-star-spacing": "off",
|
2021-07-10 04:38:42 +12:00
|
|
|
// allow paren-less arrow functions
|
2023-09-04 06:36:10 +12:00
|
|
|
"arrow-parens": "off",
|
|
|
|
"one-var": "off",
|
|
|
|
"no-void": "off",
|
|
|
|
"multiline-ternary": "off",
|
|
|
|
|
|
|
|
"import/first": "off",
|
|
|
|
"import/namespace": "error",
|
|
|
|
"import/default": "error",
|
|
|
|
"import/export": "error",
|
|
|
|
"import/extensions": "off",
|
|
|
|
"import/no-unresolved": "off",
|
|
|
|
"import/no-extraneous-dependencies": "off",
|
2023-08-19 20:43:21 +12:00
|
|
|
|
|
|
|
// The core 'import/named' rules
|
|
|
|
// does not work with type definitions
|
2023-09-04 06:36:10 +12:00
|
|
|
"import/named": "off",
|
2023-08-25 08:40:07 +12:00
|
|
|
|
2023-09-04 06:36:10 +12:00
|
|
|
"prefer-promise-reject-errors": "off",
|
2021-07-10 04:38:42 +12:00
|
|
|
|
2023-09-04 06:36:10 +12:00
|
|
|
quotes: ["warn", "single", { avoidEscape: true }],
|
2023-08-19 20:43:21 +12:00
|
|
|
|
|
|
|
// this rule, if on, would require explicit return type on the `render` function
|
2023-09-04 06:36:10 +12:00
|
|
|
"@typescript-eslint/explicit-function-return-type": "off",
|
2023-08-19 20:43:21 +12:00
|
|
|
|
|
|
|
// in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled
|
2023-09-04 06:36:10 +12:00
|
|
|
"@typescript-eslint/no-var-requires": "off",
|
2023-08-19 20:43:21 +12:00
|
|
|
|
|
|
|
// The core 'no-unused-vars' rules (in the eslint:recommended ruleset)
|
|
|
|
// does not work with type definitions
|
2023-09-04 06:36:10 +12:00
|
|
|
"no-unused-vars": "off",
|
2021-07-10 04:38:42 +12:00
|
|
|
|
|
|
|
// allow debugger during development only
|
2023-09-04 06:36:10 +12:00
|
|
|
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
|
2023-08-27 01:17:42 +12:00
|
|
|
|
|
|
|
// CUSTOM RULES
|
2023-09-04 06:36:10 +12:00
|
|
|
"object-shorthand": "off",
|
|
|
|
"quote-props": "off",
|
|
|
|
camelcase: "off",
|
|
|
|
},
|
|
|
|
};
|