This commit is contained in:
commit
b4f68f48c6
14 changed files with 872 additions and 0 deletions
62
src/index.ts
Normal file
62
src/index.ts
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import pluginPerfectionist from 'eslint-plugin-perfectionist';
|
||||
import pluginPrettier from 'eslint-plugin-prettier';
|
||||
import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
||||
import pluginSonarjs from 'eslint-plugin-sonarjs';
|
||||
import pluginUnicorn from 'eslint-plugin-unicorn';
|
||||
import { defineConfig } from 'eslint/config';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
import { sortBaseRule, sortDetailedRule } from './sort';
|
||||
|
||||
const ignores = {
|
||||
ignores: ['dist/**', '**/dist/**', 'build/**', '**/build/**'],
|
||||
} as const;
|
||||
|
||||
const configs = [
|
||||
tseslint.configs.stylisticTypeChecked,
|
||||
tseslint.configs.eslintRecommended,
|
||||
tseslint.configs.recommendedTypeChecked,
|
||||
pluginPrettierRecommended,
|
||||
pluginPerfectionist.configs['recommended-natural'],
|
||||
pluginUnicorn.configs.all,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
(pluginSonarjs.configs?.recommended ?? {}) as any, // broken sonarjs types?
|
||||
] as const;
|
||||
|
||||
export const config = defineConfig([
|
||||
...configs,
|
||||
ignores,
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: process.cwd(),
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
rules: {
|
||||
'@typescript-eslint/naming-convention': 'error',
|
||||
'perfectionist/sort-classes': ['error', sortDetailedRule],
|
||||
'perfectionist/sort-interfaces': ['error', sortBaseRule],
|
||||
'perfectionist/sort-object-types': ['error', sortBaseRule],
|
||||
'perfectionist/sort-objects': ['error', sortBaseRule],
|
||||
},
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
prettier: pluginPrettier,
|
||||
},
|
||||
rules: {
|
||||
'prettier/prettier': [
|
||||
'error',
|
||||
{
|
||||
singleQuote: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
export default config;
|
||||
Loading…
Add table
Add a link
Reference in a new issue