You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin helps you to refactor your codebase. This is an extension of [eslint-plugin-deprecate](https://github.com/AlexMost/eslint-plugin-deprecate).
6
+
This plugin helps you refactor your codebase by identifying and replacing deprecated css class names.
7
7
8
8
## Installation
9
+
First, you'll need to install [ESLint](http://eslint.org):
9
10
10
-
You'll first need to install [ESLint](http://eslint.org):
[eslint-plugin-deprecate-classnames](https://www.npmjs.com/package/eslint-plugin-deprecate-classnames) is a powerful tool for maintaining a clean and up-to-date codebase by ensuring deprecated class names are systematically identified and replaced. This is especially useful for large teams and during major refactoring efforts. By integrating this plugin, you can automate the enforcement of class name conventions and improve code quality.
122
+
123
+
For more information, visit the [npm package page](https://www.npmjs.com/package/eslint-plugin-deprecate-classnames).
124
+
125
+
## Credits
126
+
This plugin is an extension of the [eslint-plugin-deprecate](https://github.com/AlexMost/eslint-plugin-deprecate) by AlexMost. The original plugin provides a flexible way to deprecate functions and variables, and this extension builds on that foundation to specifically target and manage deprecated class names in JSX and TSX files, with a special focus on the `classes` prop used in Material-UI components.
This rule allows you to forbid the usage of deprecated Material-UI class names in your codebase and suggests alternatives. It is especially useful for large teams during a refactor process.
6
+
7
+
### Example:
8
+
Let's consider we have this configuration in `.eslintrc`:
9
+
10
+
```json
11
+
{
12
+
"plugins": ["deprecate"],
13
+
"rules": {
14
+
"deprecate/classes": ["error",
15
+
{ "name": "MuiOldClass", "use": "MuiNewClass" }
16
+
]
17
+
}
18
+
}
19
+
```
20
+
21
+
### The following patterns are considered as errors:
This rule allows you to forbid some function usage and to suggest some alternative.
6
-
Maybe really handy for large teams while refactoring codebase.
5
+
This rule allows you to forbid the usage of deprecated class names in your codebase and suggests alternatives. It is especially useful for large teams during a refactor process.
7
6
8
7
### Example:
9
8
Let's consider we have this configuration in `.eslintrc`:
@@ -12,36 +11,50 @@ Let's consider we have this configuration in `.eslintrc`:
12
11
{
13
12
"plugins": ["deprecate"],
14
13
"rules": {
15
-
"deprecate/function": ["error",
16
-
{"name": "legacyFunc", "use": "newFunc from this package"}
14
+
"deprecate/classnames": ["error",
15
+
{"name": "old-class", "use": "new-class"}
17
16
]
18
17
}
19
18
}
20
-
```
21
19
22
20
### The following patterns are considered as errors:
0 commit comments