70 lines
1.4 KiB
JavaScript
70 lines
1.4 KiB
JavaScript
import js from '@eslint/js';
|
|
import globals from 'globals';
|
|
import pluginVue from 'eslint-plugin-vue';
|
|
import pluginVuePug from 'eslint-plugin-vue-pug';
|
|
import pluginJsonc from 'eslint-plugin-jsonc';
|
|
|
|
export default [
|
|
{
|
|
ignores: [
|
|
'**/node_modules/**',
|
|
'**/dist/**',
|
|
'**/android/**',
|
|
'**/coverage/**',
|
|
'**/*.min.js'
|
|
]
|
|
},
|
|
|
|
js.configs.recommended,
|
|
{
|
|
languageOptions: {
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
...globals.es2021
|
|
}
|
|
},
|
|
rules: {
|
|
'no-unused-vars': 'warn',
|
|
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
|
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
|
}
|
|
},
|
|
|
|
...pluginVue.configs['flat/recommended'],
|
|
{
|
|
files: ['*.vue', '**/*.vue'],
|
|
plugins: {
|
|
'vue-pug': pluginVuePug
|
|
},
|
|
languageOptions: {
|
|
parser: pluginVue.parser,
|
|
parserOptions: {
|
|
parser: js.configs.recommended.parser,
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
}
|
|
},
|
|
rules: {
|
|
'vue/multi-word-component-names': 'off',
|
|
'vue/require-default-prop': 'off',
|
|
'vue/html-indent': ['error', 2],
|
|
'no-unused-vars': 'off',
|
|
'vue/component-name-in-template-casing': ['error', 'PascalCase', {
|
|
registeredComponentsOnly: true,
|
|
ignores: []
|
|
}]
|
|
}
|
|
},
|
|
|
|
...pluginJsonc.configs['flat/recommended-with-jsonc'],
|
|
{
|
|
files: ['*.json', '**/*.json'],
|
|
rules: {
|
|
'jsonc/sort-keys': 'off',
|
|
}
|
|
}
|
|
];
|