Skip to content

Commit 197dbb5

Browse files
committed
Merge branch 'feature/remove-classlist'
2 parents 8c871ae + f615f9a commit 197dbb5

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

docs/prefer-classlist.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- AUTO-GENERATED-CONTENT:START (HEADER) -->
22
# solid/prefer-classlist
33
Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames.
4-
This rule is **a warning** by default.
4+
This rule is **off** by default.
55

66
[View source](../src/rules/prefer-classlist.ts) · [View tests](../test/rules/prefer-classlist.test.ts)
77

@@ -14,7 +14,7 @@ Options shown here are the defaults. Manually configuring an array will *replace
1414

1515
```js
1616
{
17-
"solid/prefer-classlist": ["warn", {
17+
"solid/prefer-classlist": ["off", {
1818
// An array of names to treat as `classnames` functions
1919
classnames: ["cn","clsx","classnames"], // Array<string>
2020
}]

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ const plugin = {
7575
"solid/imports": 1,
7676
"solid/style-prop": 1,
7777
"solid/no-react-specific-props": 1,
78-
"solid/prefer-classlist": 1,
7978
"solid/self-closing-comp": 1,
8079
// handled by Solid compiler, opt-in style suggestion
8180
"solid/prefer-show": 0,
81+
// deprecated
82+
"solid/prefer-classlist": 0,
8283
},
8384
},
8485
typescript: {
@@ -105,12 +106,13 @@ const plugin = {
105106
"solid/imports": 1,
106107
"solid/style-prop": 1,
107108
"solid/no-react-specific-props": 1,
108-
"solid/prefer-classlist": 1,
109109
"solid/self-closing-comp": 1,
110110
// namespaces taken care of by TS
111111
"solid/no-unknown-namespaces": 0,
112112
// handled by Solid compiler, opt-in style suggestion
113113
"solid/prefer-show": 0,
114+
// deprecated
115+
"solid/prefer-classlist": 0,
114116
},
115117
},
116118
},

src/rules/prefer-classlist.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const rule: TSESLint.RuleModule<"preferClasslist", [{ classnames?: [string, ...A
66
meta: {
77
type: "problem",
88
docs: {
9-
recommended: "warn",
9+
recommended: false,
1010
description:
1111
"Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames.",
1212
url: "https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/prefer-classlist.md",
@@ -34,6 +34,7 @@ const rule: TSESLint.RuleModule<"preferClasslist", [{ classnames?: [string, ...A
3434
preferClasslist:
3535
"The classlist prop should be used instead of {{ classnames }} to efficiently set classes based on an object.",
3636
},
37+
deprecated: true,
3738
},
3839
create(context) {
3940
const classnames = context.options[0]?.classnames ?? ["cn", "clsx", "classnames"];

0 commit comments

Comments
 (0)