wip refacto
This commit is contained in:
parent
cf7fb776bd
commit
28071e585f
18 changed files with 2270 additions and 7587 deletions
|
@ -1,49 +1,67 @@
|
|||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
import globals from 'globals'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import js from '@eslint/js'
|
||||
import { FlatCompat } from '@eslint/eslintrc'
|
||||
/**
|
||||
* THIS FILE WAS AUTO-GENERATED.
|
||||
* PLEASE DO NOT EDIT IT MANUALLY.
|
||||
* ===============================
|
||||
* IF YOU'RE COPYING THIS INTO AN ESLINT CONFIG, REMOVE THIS COMMENT BLOCK.
|
||||
*/
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
})
|
||||
import path from 'node:path';
|
||||
|
||||
export default defineConfig([globalIgnores([
|
||||
'node_modules',
|
||||
'client/lib'
|
||||
]), {
|
||||
extends: compat.extends('airbnb-base'),
|
||||
import { includeIgnoreFile } from '@eslint/compat';
|
||||
import js from '@eslint/js';
|
||||
import { configs, plugins } from 'eslint-config-airbnb-extended';
|
||||
import { rules as prettierConfigRules } from 'eslint-config-prettier';
|
||||
import prettierPlugin from 'eslint-plugin-prettier';
|
||||
|
||||
languageOptions: { ecmaVersion: 13 },
|
||||
export const projectRoot = path.resolve('.');
|
||||
export const gitignorePath = path.resolve(projectRoot, '.gitignore');
|
||||
|
||||
rules: {
|
||||
semi: ['error', 'never'],
|
||||
const jsConfig = [
|
||||
// ESLint Recommended Rules
|
||||
{
|
||||
name: 'js/config',
|
||||
...js.configs.recommended,
|
||||
},
|
||||
// Stylistic Plugin
|
||||
plugins.stylistic,
|
||||
// Import X Plugin
|
||||
plugins.importX,
|
||||
// Airbnb Base Recommended Config
|
||||
...configs.base.recommended,
|
||||
];
|
||||
|
||||
'max-len': ['error', { code: 104 }],
|
||||
const nodeConfig = [
|
||||
// Node Plugin
|
||||
plugins.node,
|
||||
// Airbnb Node Recommended Config
|
||||
...configs.node.recommended,
|
||||
];
|
||||
|
||||
'vars-on-top': 'off',
|
||||
'class-methods-use-this': 'off',
|
||||
'import/no-unresolved': 'off',
|
||||
'import/extensions': ['error', 'always'],
|
||||
'import/prefer-default-export': ['off'],
|
||||
'no-use-before-define': ['off'],
|
||||
eqeqeq: ['error', 'smart'],
|
||||
'comma-dangle': ['error', 'never'],
|
||||
const prettierConfig = [
|
||||
// Prettier Plugin
|
||||
{
|
||||
name: 'prettier/plugin/config',
|
||||
plugins: {
|
||||
prettier: prettierPlugin,
|
||||
},
|
||||
},
|
||||
// Prettier Config
|
||||
{
|
||||
name: 'prettier/config',
|
||||
rules: {
|
||||
...prettierConfigRules,
|
||||
'prettier/prettier': 'error',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
'object-curly-newline': ['error', { multiline: true }],
|
||||
|
||||
'func-names': ['error', 'never'],
|
||||
'space-before-function-paren': ['error', 'never'],
|
||||
|
||||
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
|
||||
|
||||
'no-new': 'off',
|
||||
'no-restricted-syntax': 'off',
|
||||
'guard-for-in': 'off'
|
||||
}
|
||||
}])
|
||||
export default [
|
||||
// Ignore .gitignore files/folder in eslint
|
||||
includeIgnoreFile(gitignorePath),
|
||||
// Javascript Config
|
||||
...jsConfig,
|
||||
// Node Config
|
||||
...nodeConfig,
|
||||
// Prettier Config
|
||||
...prettierConfig,
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue