Upgrade to ESLint 9
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
/* eslint-disable unicorn/string-content */
|
||||
import type { UnicornRulesObject } from '@aet/eslint-define-config/src/rules/unicorn';
|
||||
import unicorn from 'eslint-plugin-unicorn';
|
||||
import globals from 'globals';
|
||||
|
||||
import { error, off, warn } from '../constants';
|
||||
import { defineMiddleware } from '../middleware';
|
||||
import { defineConfig } from '../types';
|
||||
|
||||
const suggest = (suggest: string) => ({ suggest, fix: false });
|
||||
|
||||
@ -99,13 +100,31 @@ const unicornRules: Partial<UnicornRulesObject> = {
|
||||
'unicorn/template-indent': warn,
|
||||
};
|
||||
|
||||
export const unicorn = defineMiddleware((config, { addRules }) => {
|
||||
config.plugins.push('unicorn');
|
||||
addRules(unicornRules);
|
||||
config.overrides.push({
|
||||
// export const unicorn = defineMiddleware((config, { addRules }) => {
|
||||
// config.plugins.push('unicorn');
|
||||
// addRules(unicornRules);
|
||||
// config.overrides.push({
|
||||
// files: ['*.test.ts', '*.test.tsx'],
|
||||
// rules: {
|
||||
// 'unicorn/no-useless-undefined': off,
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
languageOptions: {
|
||||
globals: globals.builtin,
|
||||
},
|
||||
plugins: {
|
||||
unicorn,
|
||||
},
|
||||
rules: unicornRules,
|
||||
},
|
||||
{
|
||||
files: ['*.test.ts', '*.test.tsx'],
|
||||
rules: {
|
||||
'unicorn/no-useless-undefined': off,
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
]);
|
||||
|
Reference in New Issue
Block a user