Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ The plugin offers three recommended configurations to help you get started quick
- `stylistic`: Enforces stylistic rules for tailwind classes.
- `correctness`: Enforces correctness rules for tailwind classes.
- `recommended`: Enforces both stylistic and correctness rules.

- `flat/stylistic`: same as `stylistic` but for ESLint v9 Flat Config.
- `flat/correctness`: same as `correctness` but for ESLint v9 Flat Config.
- `flat/recommended`: same as `recommended` but for ESLint v9 Flat Config.

By default:

- `stylistic` rules are reported as warnings
Expand Down
13 changes: 13 additions & 0 deletions src/configs/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const plugin = {
} satisfies ESLint.Plugin;

const plugins = [plugin.meta.name];
const flatPlugins = { [plugin.meta.name]: plugin };


const getStylisticRules = (severity: "error" | "warn" = "warn") => {
Expand Down Expand Up @@ -66,6 +67,18 @@ const createConfig = (
plugins,
rules: getRulesFunction("warn")
},
[`flat/${name}-error`]: {
plugins: flatPlugins,
rules: getRulesFunction("error")
},
[`flat/${name}-warn`]: {
plugins: flatPlugins,
rules: getRulesFunction("warn")
},
[`flat/${name}`]: {
plugins: flatPlugins,
rules: getRulesFunction()
},
[name]: {
plugins,
rules: getRulesFunction()
Expand Down