200 lines
7.0 KiB
JavaScript
200 lines
7.0 KiB
JavaScript
import vue from 'eslint-plugin-vue';
|
|
import cypress from 'eslint-plugin-cypress';
|
|
import importt from 'eslint-plugin-import';
|
|
import globals from 'globals';
|
|
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import js from '@eslint/js';
|
|
import { FlatCompat } from '@eslint/eslintrc';
|
|
const compat = new FlatCompat({
|
|
baseDirectory: import.meta.url,
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all,
|
|
});
|
|
|
|
export default {
|
|
// 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)
|
|
|
|
plugins: { vue: vue, cypress: cypress, importt: importt },
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
...globals.browser,
|
|
...vue.environments['setup-compiler-macros']['setup-compiler-macros'],
|
|
ga: 'readonly',
|
|
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',
|
|
},
|
|
|
|
ecmaVersion: 2018,
|
|
sourceType: 'module',
|
|
|
|
parserOptions: {
|
|
parser: '@babel/eslint-parser',
|
|
},
|
|
},
|
|
// files: ['test/cypress/**/*.*'],
|
|
// rules: {
|
|
// semi: 'error',
|
|
// 'space-before-function-paren': 0,
|
|
// 'prefer-promise-reject-errors': 0,
|
|
// 'vue/no-multiple-template-root': 0,
|
|
// },
|
|
rules: {
|
|
'generator-star-spacing': 'off',
|
|
'arrow-parens': 'off',
|
|
'one-var': 'off',
|
|
'no-void': 'off',
|
|
'multiline-ternary': 'off',
|
|
'js/first': 'off',
|
|
'vue/prefer-import-from-vue': 'error',
|
|
'importt/first': 'off',
|
|
'importt/dynamic-import-chunkname': 'off',
|
|
'importt/named': 'error',
|
|
'importt/namespace': 'error',
|
|
'importt/default': 'error',
|
|
'importt/export': 'error',
|
|
'importt/extensions': 'off',
|
|
'importt/no-unresolved': 'off',
|
|
'importt/no-extraneous-dependencies': 'off',
|
|
'importt/no-import-module-exports': 'off',
|
|
'importt/no-self-import': 'off',
|
|
semi: 'off',
|
|
'space-before-function-paren': 'off',
|
|
'no-undef': 'error',
|
|
'no-unused-vars': 'warn',
|
|
'no-console': 'error',
|
|
'no-debugger': 'off',
|
|
'no-useless-escape': 'error',
|
|
'no-prototype-builtins': 'error',
|
|
'no-async-promise-executor': 'error',
|
|
'no-irregular-whitespace': 'error',
|
|
'no-constant-condition': 'error',
|
|
'no-unsafe-finally': 'error',
|
|
'no-extend-native': 'error',
|
|
'vue/no-unused-components': 'error',
|
|
'vue/no-unused-properties': 'error',
|
|
'vue/no-multiple-template-root': 'error',
|
|
'vue/no-v-html': 'error',
|
|
'vue/no-v-model-argument': 'error',
|
|
'vue/no-parsing-error': 'error',
|
|
'vue/no-deprecated-slot-attribute': 'error',
|
|
'prefer-promise-reject-errors': 'error',
|
|
// },
|
|
// {
|
|
|
|
// },
|
|
},
|
|
// linterOptions: {
|
|
// reportUnusedInlineConfigs: 'error',
|
|
// },
|
|
ignores: [
|
|
'/dist',
|
|
'/src-capacitor',
|
|
'/src-cordova',
|
|
'/.quasar',
|
|
'/node_modules',
|
|
'.eslintrc.js',
|
|
],
|
|
// Rules order is important, please avoid shuffling them
|
|
// extends: [
|
|
// 'standard',
|
|
// // Base ESLint recommended rules
|
|
// 'eslint:recommended',
|
|
|
|
// // Uncomment any of the lines below to choose desired strictness,
|
|
// // but leave only one uncommented!
|
|
// // See https://eslint.vuejs.org/rules/#available-rules
|
|
// // '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)
|
|
|
|
// // https://github.com/prettier/eslint-config-prettier#installation
|
|
// // usage with Prettier, provided by 'eslint-config-prettier'.
|
|
// 'prettier',
|
|
// ],
|
|
|
|
// plugins: [
|
|
// // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
|
|
// // required to lint *.vue files
|
|
// 'vue',
|
|
|
|
// // https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
|
|
// // Prettier has not been included as plugin to avoid performance impact
|
|
// // add it as an extension for your IDE
|
|
// ],
|
|
|
|
// globals: {},
|
|
|
|
// add your custom rules here
|
|
// rules: {
|
|
// // allow async-await
|
|
// 'generator-star-spacing': 'off',
|
|
// // allow paren-less arrow functions
|
|
// 'arrow-parens': 'off',
|
|
// 'one-var': 'off',
|
|
// 'no-void': 'off',
|
|
// 'multiline-ternary': 'off',
|
|
|
|
// 'import/first': 'off',
|
|
// 'import/named': 'error',
|
|
// 'import/namespace': 'error',
|
|
// 'import/default': 'error',
|
|
// 'import/export': 'error',
|
|
// 'import/extensions': 'off',
|
|
// 'import/no-unresolved': 'off',
|
|
// 'import/no-extraneous-dependencies': 'off',
|
|
// semi: 'off',
|
|
// 'space-before-function-paren': 'off',
|
|
// 'no-undef': 'error',
|
|
// 'no-unused-vars': 'warn',
|
|
// 'no-console': 'error',
|
|
// 'no-debugger': 'error',
|
|
// 'no-useless-escape': 'error',
|
|
// 'no-prototype-builtins': 'error',
|
|
// 'no-async-promise-executor': 'error',
|
|
// 'no-irregular-whitespace': 'error',
|
|
// 'no-constant-condition': 'error',
|
|
// 'no-unsafe-finally': 'error',
|
|
// 'no-extend-native': 'error',
|
|
|
|
// 'vue/no-unused-components': 'error',
|
|
// 'vue/no-unused-properties': 'error',
|
|
// 'vue/no-multiple-template-root': 'error',
|
|
// 'vue/no-v-html': 'error',
|
|
// 'vue/no-v-model-argument': 'error',
|
|
// 'vue/no-parsing-error': 'error',
|
|
// 'vue/no-deprecated-slot-attribute': 'error',
|
|
|
|
// 'prefer-promise-reject-errors': 'error',
|
|
|
|
// // allow debugger during development only
|
|
// 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
// },
|
|
// overrides: [
|
|
// {
|
|
// files: ['test/cypress/**/*.*'],
|
|
// extends: [
|
|
// // Add Cypress-specific lint rules, globals and Cypress plugin
|
|
// // See https://github.com/cypress-io/eslint-plugin-cypress#rules
|
|
// 'plugin:cypress/recommended',
|
|
// ],
|
|
// rules: {
|
|
// semi: 'off',
|
|
// 'space-before-function-paren': 'off',
|
|
// 'prefer-promise-reject-errors': 'off',
|
|
// 'vue/no-multiple-template-root': 'off',
|
|
// },
|
|
// },
|
|
// ],
|
|
};
|