Use separate eslint config file

Adapted from splatoon3.ink
This commit is contained in:
Matt Isenhower 2024-11-07 08:45:36 -08:00
parent eec92030aa
commit 95c072cb6e
2 changed files with 56 additions and 18 deletions

56
.eslintrc.cjs Normal file
View File

@ -0,0 +1,56 @@
/* eslint-env node */
// const createAliasSetting = require('@vue/eslint-config-airbnb/createAliasSetting');
module.exports = {
'root': true,
'extends': [
'plugin:vue/vue3-recommended',
'eslint:recommended',
],
'rules': {
// ESLint
'indent': ['warn', 2, { 'SwitchCase': 1 }],
'comma-dangle': ['warn', 'always-multiline'],
'no-unused-vars': ['warn', { 'args': 'none' }],
'semi': 'warn',
'quotes': ['warn' , 'single'],
'object-curly-spacing': ['warn', 'always'],
// Vue
'vue/multi-word-component-names': 'off',
'vue/require-default-prop': 'off',
'vue/max-attributes-per-line': ['warn', { singleline: { max: 4 } }],
'vue/html-self-closing': ['warn', { html: { void: 'always' } }],
},
'globals': {
'__dirname': 'readonly',
'process': 'readonly',
'require': 'readonly',
'module': 'readonly',
'Buffer': 'readonly',
},
'overrides': [
{
'files': ['src/**'],
'rules': {
'@dword-design/import-alias/prefer-alias': ['warn', { 'alias': {
'@': './src',
} }],
},
},
],
'env': {
'vue/setup-compiler-macros': true,
},
'ignorePatterns': [
'src/assets/i18n/index.mjs', // "assert" syntax is currently unrecognized
],
'parserOptions': {
'ecmaVersion': 2022,
},
settings: {
// ...createAliasSetting({
// '@': './src',
// }),
},
};

View File

@ -62,24 +62,6 @@
"shipit-cli": "^5.3.0",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {
"no-unused-vars": "warn",
"no-prototype-builtins": 0,
"@vue/multi-word-component-names": 0
},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}