# eslint-plugin-jimu-theme

> This plug-in is used to assist in migrating jimu-theme variables to the new version.

Latest version **2.2.4** (published 2026-08-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-jimu-theme
pnpm add eslint-plugin-jimu-theme
yarn add eslint-plugin-jimu-theme
bun add eslint-plugin-jimu-theme
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.2.4 |
| Published | 2026-08-06 |
| First published | 2024-03-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^14.17.0 \|\| ^16.0.0 \|\| >= 18.0.0 |
| Dependencies | 2 |
| Unpacked size | 362.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | ming8525 |
| Maintainers | ming8525, kaifeiji |
| Keywords | eslint, eslintplugin, eslint-plugin |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-jimu-theme
- Repository: https://github.com/ming8525/eslint-plugin-jimu-theme
- Homepage: https://github.com/ming8525/eslint-plugin-jimu-theme#readme
- Issues: https://github.com/ming8525/eslint-plugin-jimu-theme/issues
- npm.io page: https://npm.io/package/eslint-plugin-jimu-theme

## Dependencies (2)

- [minimatch](https://npm.io/package/minimatch.md) ^10.2.6
- [requireindex](https://npm.io/package/requireindex.md) ^1.2.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 2.2.4 (latest) — 2026-08-06
- 2.2.3 — 2025-12-12
- 2.2.2 — 2025-08-12
- 2.2.1 — 2025-07-17
- 2.2.0 — 2025-07-17
- 2.1.0 — 2025-07-03
- 2.1.0-beta.4 — 2025-05-22
- 2.1.0-beta.3 — 2025-05-22
- 2.1.0-beta.2 — 2024-11-21
- 2.1.0-beta.1 — 2024-11-20
- 2.1.0-beta.0 — 2024-11-19
- 2.0.0 — 2024-11-18
- 1.0.1-beta.14 — 2024-04-01
- 1.0.1-beta.13 — 2024-03-28
- 1.0.1-beta.12 — 2024-03-27
- … 11 more at https://npm.io/package/eslint-plugin-jimu-theme/versions

## README

# eslint-plugin-jimu-theme

This plug-in is used to assist in migrating jimu-theme variables to the new version.

## Installation

You'll first need to install [ESLint](https://eslint.org/):

```sh
npm i eslint --save-dev
```

Next, install `eslint-plugin-jimu-theme`:

```sh
npm install eslint-plugin-jimu-theme --save-dev
```

## Usage

Add `jimu-theme` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
    "plugins": [
        "jimu-theme"
    ]
}
```


Then configure the rules you want to use under the rules section.

```json
{
    "rules": {
        "jimu-theme/rule-name": 2
    }
}
```

## Note

This plugin is only for assisting in `jimu-theme` upgrades and should not be used for other purposes.


The `no-classic-*` rules are used to upgrade corresponding variables, for example:

```
theme.colors.primary => theme.sys.color.primary.main
```

Rule `no-classic-variables` contains all other rules prefixed with `no-classic` (except rule `no-classic-css-utilities`,  `no-classic-css-vars`), so you can choose to replace them with rule `no-classic-variables`.

The rule `no-unnecessary-template-vars` is intended to clean up abnormal code after a theme upgrade, such as:

```
~~const style = `color: ${'transparent'};`~~

const style = `color: transparent;`
```

The rule `no-unnecessary-template-vars` need to be placed after `no-classic-*`.

Then put rule `no-classic-variables-left` after all rules to check whether any classic theme variables are not recognized.

Furthermore, after automatic fixing, there might still be incorrect code remaining, which requires reviewing each file individually.

For example:

Before fixing:
```js
const colors = theme.colors
const primary = colors.primary
```
After fixing:
```js
const colors = theme.colors
const primary = theme.sys.color.primary.main
```
You can see that after the fix, a variable named "theme" is missing, and the definition of the "colors" variable is no longer needed. These require further manual processing.
If you perform global automatic fixing, you need to pay attention to the warning and error messages eslint prints on the console to complete this part of the manual fixing.

We recommend autofixing files one by one rather than applying a global autofix directly.

## Rules

<!-- begin auto-generated rules list -->

🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).

| Name                                                                       | Description                                                                                                                                                                                                                             | 🔧 |
| :------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :- |
| [no-classic-border](docs/rules/no-classic-border.md)                       | This rule facilitates the deprecation of `border` variables in the classic theme and provides automatic fixes to replace these border variables with variables from the new theme or fallback values.                                   | 🔧 |
| [no-classic-border-radius](docs/rules/no-classic-border-radius.md)         | This rule facilitates the deprecation of `borderRadiuses` variables in the classic theme and provides automatic fixes to replace these borderRadiuses variables with variables from the new theme or fallback values.                   | 🔧 |
| [no-classic-colors](docs/rules/no-classic-colors.md)                       | This rule updates `colors` variables from old classic theme to new theme.                                                                                                                                                               | 🔧 |
| [no-classic-css-utilities](docs/rules/no-classic-css-utilities.md)         | This rule facilitates the upgrade of css utilities from the classic theme to the new theme.                                                                                                                                             | 🔧 |
| [no-classic-css-vars](docs/rules/no-classic-css-vars.md)                   | This rule facilitates the transition of CSS variables representing colors from the classic theme to the new theme.                                                                                                                      | 🔧 |
| [no-classic-dark-theme](docs/rules/no-classic-dark-theme.md)               | This rule facilitates the deprecation of `darkTheme` variables in the classic theme and provides automatic fixes to replace it with variables from the new theme.                                                                       | 🔧 |
| [no-classic-elements](docs/rules/no-classic-elements.md)                   | This rule facilitates the deprecation of elements(e.g header, footer, body, link) variables in the classic theme and provides automatic fixes to replace these elements variables with variables from the new theme or fallback values. | 🔧 |
| [no-classic-focused-styles](docs/rules/no-classic-focused-styles.md)       | This rule facilitates the deprecation of `focusedStyles` variables in the classic theme and provides automatic fixes to replace these `focusedStyles` variables with variables from the new theme or fallback values.                   | 🔧 |
| [no-classic-shadow](docs/rules/no-classic-shadow.md)                       | This rule facilitates the deprecation of `boxShadows` variables in the classic theme and provides automatic fixes to replace these boxShadows variables with variables from the new theme.                                              | 🔧 |
| [no-classic-sizes](docs/rules/no-classic-sizes.md)                         | This rule facilitates the deprecation of `sizes` variables in the classic theme and provides automatic fixes to replace these sizes variables with variables from the new theme.                                                        | 🔧 |
| [no-classic-surface](docs/rules/no-classic-surface.md)                     | This rule facilitates the deprecation of `surfaces` variables in the classic theme and provides automatic fixes to replace these border variables with variables from the new theme or fallback values.                                 | 🔧 |
| [no-classic-typography](docs/rules/no-classic-typography.md)               | This rule facilitates the deprecation of `typography` variables in the classic theme and provides automatic fixes to replace these typography variables with variables from the new theme or fallback values.                           | 🔧 |
| [no-classic-variables](docs/rules/no-classic-variables.md)                 | This rule updates variables from old classic theme to new theme.                                                                                                                                                                        | 🔧 |
| [no-classic-variables-left](docs/rules/no-classic-variables-left.md)       | This rule is to check whether there are any remaining classical variables.                                                                                                                                                              | 🔧 |
| [no-gutters](docs/rules/no-gutters.md)                                     | This rule facilitates the deprecation of `gutters` variables in the theme and provides automatic fixes to replace these gutter variables with specific values.                                                                          | 🔧 |
| [no-improperly-color](docs/rules/no-improperly-color.md)                   | This rule is meant to identify the improper use of theme color variables in widgets or components.                                                                                                                                      | 🔧 |
| [no-ref-palette](docs/rules/no-ref-palette.md)                             | This rule is used to check whether a theme ref palette variable is being used.                                                                                                                                                          | 🔧 |
| [no-unnecessary-template-vars](docs/rules/no-unnecessary-template-vars.md) | Remove unnecessary template string variables. Note: If it is used for theme upgrade, this rule should be called after other rules for upgrading the theme to fix abnormal results caused by the upgrade.                                | 🔧 |

<!-- end auto-generated rules list -->

---
_Source: https://npm.io/package/eslint-plugin-jimu-theme · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
