add new lesson mode and started code refraction
This commit is contained in:
@@ -1,69 +1,88 @@
|
||||
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';
|
||||
import { FlatCompat } from '@eslint/eslintrc';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const filename = fileURLToPath(import.meta.url);
|
||||
const dirname = path.dirname(filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: dirname,
|
||||
});
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: [
|
||||
'**/node_modules/**',
|
||||
'**/dist/**',
|
||||
'**/android/**',
|
||||
'**/coverage/**',
|
||||
'**/*.min.js'
|
||||
]
|
||||
},
|
||||
{
|
||||
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'
|
||||
}
|
||||
},
|
||||
...compat.extends('airbnb-base'),
|
||||
|
||||
...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: []
|
||||
}]
|
||||
}
|
||||
},
|
||||
js.configs.recommended,
|
||||
|
||||
...pluginJsonc.configs['flat/recommended-with-jsonc'],
|
||||
{
|
||||
files: ['*.json', '**/*.json'],
|
||||
rules: {
|
||||
'jsonc/sort-keys': 'off',
|
||||
}
|
||||
}
|
||||
{
|
||||
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',
|
||||
'import/extensions': 'off',
|
||||
'import/no-unresolved': 'off',
|
||||
'import/prefer-default-export': 'off',
|
||||
},
|
||||
},
|
||||
|
||||
...pluginVue.configs['flat/recommended'],
|
||||
{
|
||||
files: ['*.vue', '**/*.vue'],
|
||||
languageOptions: {
|
||||
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': 'off',
|
||||
'vue/no-parsing-error': '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',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
files: ['vite.config.js', 'vite.config.ts'],
|
||||
rules: {
|
||||
'import/no-unresolved': 'off',
|
||||
'import/no-extraneous-dependencies': 'off',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user