Update
This commit is contained in:
@ -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,
|
||||
|
5
src/presets/tailwind.ts
Normal file
5
src/presets/tailwind.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { off } from '../constants';
|
||||
|
||||
export const tailwindRules = {
|
||||
'tailwindcss/no-custom-classname': off,
|
||||
} as const;
|
Reference in New Issue
Block a user