This commit is contained in:
Alex
2024-03-30 02:06:38 -04:00
parent 19b07691fc
commit 4d2762de39
7 changed files with 1005 additions and 553 deletions

View File

@ -14,6 +14,7 @@ import { jsDocRules } from './presets/jsdoc';
import { graphqlRules } from './presets/graphql';
import { localRules } from './presets/local';
import { error, warn, off } from './constants';
import { tailwindRules } from './presets/tailwind';
export { error, warn, off };
@ -118,6 +119,9 @@ export function extendConfig({
const hasJsDoc = plugins.includes('jsdoc');
const hasGraphQL = plugins.includes('@graphql-eslint');
const hasNext = ensureArray(_extends).some(name => name.includes(':@next/next'));
const hasTailwind = ensureArray(_extends).some(name =>
name.includes('plugin:tailwindcss/'),
);
const ruleDir = false; // ?? findCacheDirectory({ name: '_eslint-rules' });
if (ruleDir) {
@ -200,7 +204,7 @@ export function extendConfig({
...reactRules,
'react/no-unknown-property': [
error,
{ ignore: hasNext ? ['emotion', 'next'] : ['emotion'] },
{ ignore: hasNext ? ['css', 'next'] : ['css'] },
],
}),
...(hasReactRefresh && {
@ -209,6 +213,7 @@ export function extendConfig({
...(hasUnicorn && unicornRules),
...(hasJsDoc && jsDocRules),
...(hasGraphQL && graphqlRules),
...(hasTailwind && tailwindRules),
...rules,
},
...rest,