Skip to content

Commit 9a071f7

Browse files
committed
feat(tailwindcss): Enable no-unnecessary-arbitrary-value
1 parent 5a05c4e commit 9a071f7

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

src/configs/tailwindcss.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export async function tailwindcss(
2323
'tailwindcss/no-arbitrary-value': 'off',
2424
'tailwindcss/no-contradicting-classname': 'error',
2525
'tailwindcss/no-custom-classname': 'off',
26+
'tailwindcss/no-unnecessary-arbitrary-value': 'warn',
2627

2728
...overrides,
2829
},

src/types/rules/tailwindcss/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { MigrationFromTailwind_2Rule } from './migration-from-tailwind-2'
55
import type { NoArbitraryValueRule } from './no-arbitrary-value'
66
import type { NoContradictingClassnameRule } from './no-contradicting-classname'
77
import type { NoCustomClassnameRule } from './no-custom-classname'
8+
import type { NoUnnecessaryArbitraryValueRule } from './no-unnecessary-arbitrary-value'
89

910
/**
1011
* All TailwindCss rules.
@@ -15,4 +16,5 @@ export type TailwindCssRules = ClassnamesOrderRule &
1516
MigrationFromTailwind_2Rule &
1617
NoArbitraryValueRule &
1718
NoContradictingClassnameRule &
18-
NoCustomClassnameRule
19+
NoCustomClassnameRule &
20+
NoUnnecessaryArbitraryValueRule
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { RuleConfig } from '../rule-config'
2+
3+
/**
4+
* Option.
5+
*/
6+
export interface NoUnnecessaryArbitraryValueOption {
7+
callees?: string[]
8+
ignoredKeys?: string[]
9+
config?: string | Record<string, any>
10+
tags?: string[]
11+
12+
[k: string]: any
13+
}
14+
15+
/**
16+
* Options.
17+
*/
18+
export type NoUnnecessaryArbitraryValueOptions = [
19+
NoUnnecessaryArbitraryValueOption?,
20+
]
21+
22+
/**
23+
* Avoid unjustified arbitrary classnames.
24+
* @see [no-unnecessary-arbitrary-value](https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-unnecessary-arbitrary-value.md)
25+
*/
26+
export type NoUnnecessaryArbitraryValueRuleConfig =
27+
RuleConfig<NoUnnecessaryArbitraryValueOptions>
28+
29+
/**
30+
* Avoid unjustified arbitrary classnames.
31+
* @see [no-unnecessary-arbitrary-value](https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-unnecessary-arbitrary-value.md)
32+
*/
33+
export interface NoUnnecessaryArbitraryValueRule {
34+
/**
35+
* Avoid unjustified arbitrary classnames.
36+
* @see [no-unnecessary-arbitrary-value](https://github.com/francoismassart/eslint-plugin-tailwindcss/tree/master/docs/rules/no-unnecessary-arbitrary-value.md)
37+
*/
38+
'tailwindcss/no-unnecessary-arbitrary-value': NoUnnecessaryArbitraryValueRuleConfig
39+
}

0 commit comments

Comments
 (0)