2025-02-08 15:45:16 +08:00
|
|
|
import antfu from '@antfu/eslint-config'
|
|
|
|
import js from '@eslint/js'
|
|
|
|
import tailwind from 'eslint-plugin-tailwindcss'
|
|
|
|
import ts from 'typescript-eslint'
|
|
|
|
|
|
|
|
const antConfig = await antfu({ jsonc: false })
|
2025-02-08 17:50:35 +08:00
|
|
|
|
2025-02-08 15:45:16 +08:00
|
|
|
const eslintConfig = [
|
|
|
|
...antConfig,
|
|
|
|
js.configs.recommended,
|
|
|
|
...ts.configs.recommended,
|
|
|
|
...tailwind.configs['flat/recommended'],
|
|
|
|
{
|
|
|
|
settings: {
|
|
|
|
tailwindcss: {
|
|
|
|
// These are the default values but feel free to customize
|
|
|
|
callees: ['classnames', 'clsx', 'ctl', 'cn'],
|
|
|
|
config: 'tailwind.config.js', // returned from `loadConfig()` utility if not provided
|
|
|
|
cssFiles: [
|
|
|
|
'**/*.css',
|
|
|
|
'!**/node_modules',
|
|
|
|
'!**/.*',
|
|
|
|
'!**/dist',
|
|
|
|
'!**/build',
|
2025-02-08 17:50:35 +08:00
|
|
|
'!**/.storybook',
|
|
|
|
'!**/.next',
|
|
|
|
'!**/.output',
|
|
|
|
'!**/public',
|
|
|
|
'!**/out',
|
2025-02-08 15:45:16 +08:00
|
|
|
],
|
|
|
|
cssFilesRefreshRate: 5_000,
|
|
|
|
removeDuplicates: true,
|
|
|
|
skipClassAttribute: false,
|
|
|
|
whitelist: [],
|
|
|
|
tags: [], // can be set to e.g. ['tw'] for use in tw`bg-blue`
|
|
|
|
classRegex: '^class(Name)?$', // can be modified to support custom attributes. E.g. "^tw$" for `twin.macro`
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2025-02-08 17:50:35 +08:00
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2025-02-08 17:52:10 +08:00
|
|
|
ignores: ['node_modules/**', '.next/**', '.storybook/**', 'build/**', 'dist/**', 'out/**', 'public/**'],
|
2025-02-08 15:45:16 +08:00
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
export default eslintConfig
|