165 lines
4.8 KiB
JavaScript
165 lines
4.8 KiB
JavaScript
import js from '@eslint/js';
|
|
import globals from 'globals';
|
|
import tsParser from '@typescript-eslint/parser';
|
|
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
import vueParser from 'vue-eslint-parser';
|
|
import vuePlugin from 'eslint-plugin-vue';
|
|
import prettierPlugin from 'eslint-plugin-prettier';
|
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
import unusedImports from 'eslint-plugin-unused-imports';
|
|
import importPlugin from 'eslint-plugin-import';
|
|
|
|
const prettierOptions = {
|
|
semi: true,
|
|
singleQuote: true,
|
|
singleAttributePerLine: false,
|
|
htmlWhitespaceSensitivity: 'css',
|
|
printWidth: 80,
|
|
tabWidth: 4,
|
|
endOfLine: 'auto',
|
|
plugins: ['prettier-plugin-tailwindcss'],
|
|
tailwindFunctions: ['clsx', 'cn', 'cva'],
|
|
tailwindStylesheet: 'resources/css/app.css',
|
|
};
|
|
|
|
const eslintConfig = [
|
|
{
|
|
ignores: [
|
|
'bootstrap/ssr/**',
|
|
'**/dist/**',
|
|
'**/node_modules/**',
|
|
'native/src-tauri/target/**',
|
|
'native/src-tauri/gen/**',
|
|
'.github/**',
|
|
'**/*.yml',
|
|
'**/*.yaml',
|
|
'docker-compose.yml',
|
|
'docker/**',
|
|
'vendor/**',
|
|
'storage/**',
|
|
'bootstrap/cache/**',
|
|
'public/build/**',
|
|
'public/hot',
|
|
'resources/js/actions/**',
|
|
'resources/js/components/ui/**',
|
|
'resources/js/routes/**',
|
|
'resources/js/wayfinder/**',
|
|
'resources/views/mail/**',
|
|
],
|
|
},
|
|
|
|
js.configs.recommended,
|
|
|
|
{
|
|
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.es2023,
|
|
},
|
|
},
|
|
plugins: {
|
|
'@typescript-eslint': tsPlugin,
|
|
prettier: prettierPlugin,
|
|
'unused-imports': unusedImports,
|
|
'simple-import-sort': simpleImportSort,
|
|
import: importPlugin,
|
|
},
|
|
rules: {
|
|
'prettier/prettier': ['warn', prettierOptions],
|
|
|
|
'@typescript-eslint/comma-dangle': 'off',
|
|
'@typescript-eslint/consistent-type-imports': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
'no-unused-vars': 'off',
|
|
|
|
'import/prefer-default-export': 'off',
|
|
|
|
'simple-import-sort/imports': 'off',
|
|
'simple-import-sort/exports': 'off',
|
|
|
|
'class-methods-use-this': 'off',
|
|
'unused-imports/no-unused-imports': 'warn',
|
|
'unused-imports/no-unused-vars': 'off',
|
|
'no-plusplus': 'off',
|
|
'no-restricted-syntax': [
|
|
'error',
|
|
'LabeledStatement',
|
|
'WithStatement',
|
|
],
|
|
'no-await-in-loop': 'off',
|
|
'no-param-reassign': 'off',
|
|
'no-underscore-dangle': 'off',
|
|
curly: 'error',
|
|
'no-nested-ternary': 'off',
|
|
},
|
|
},
|
|
|
|
{
|
|
files: ['**/*.vue'],
|
|
languageOptions: {
|
|
parser: vueParser,
|
|
parserOptions: {
|
|
parser: tsParser,
|
|
ecmaVersion: 2022,
|
|
sourceType: 'module',
|
|
extraFileExtensions: ['.vue'],
|
|
},
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.es2023,
|
|
},
|
|
},
|
|
plugins: {
|
|
vue: vuePlugin,
|
|
'@typescript-eslint': tsPlugin,
|
|
prettier: prettierPlugin,
|
|
'unused-imports': unusedImports,
|
|
'simple-import-sort': simpleImportSort,
|
|
import: importPlugin,
|
|
},
|
|
rules: {
|
|
'prettier/prettier': ['warn', prettierOptions],
|
|
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
'no-unused-vars': 'off',
|
|
'unused-imports/no-unused-imports': 'warn',
|
|
'unused-imports/no-unused-vars': 'off',
|
|
|
|
'vue/multi-word-component-names': 'off',
|
|
'vue/html-self-closing': 'off',
|
|
'vue/max-attributes-per-line': 'off',
|
|
'vue/singleline-html-element-content-newline': 'off',
|
|
'vue/multiline-html-element-content-newline': 'off',
|
|
|
|
'class-methods-use-this': 'off',
|
|
'no-plusplus': 'off',
|
|
'no-await-in-loop': 'off',
|
|
'no-param-reassign': 'off',
|
|
'no-underscore-dangle': 'off',
|
|
curly: 'error',
|
|
'no-nested-ternary': 'off',
|
|
},
|
|
},
|
|
|
|
{
|
|
files: ['**/*.yml', '**/*.yaml'],
|
|
plugins: {
|
|
prettier: prettierPlugin,
|
|
},
|
|
rules: {
|
|
'prettier/prettier': [
|
|
'warn',
|
|
{
|
|
tabWidth: 2,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
];
|
|
|
|
export default eslintConfig;
|