Skip to content

Commit 9fe40ce

Browse files
committed
Adjusted eslint configs for compatibility
1 parent 53446e0 commit 9fe40ce

File tree

4 files changed

+35
-13
lines changed

4 files changed

+35
-13
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { Linter } from "eslint";
2+
import recommended from "./recommended";
3+
4+
export default {
5+
recommended,
6+
/** Will be populated from main entry file to keep backward compatible. */
7+
flat: {} as Record<string, Linter.FlatConfig>,
8+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Linter } from 'eslint';
2+
3+
export default {
4+
rules: {
5+
'@dnn-elements/no-label-slot-in-checkbox': "error",
6+
}
7+
} satisfies Linter.BaseConfig;
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
import { noLabelSlotInCheckbox } from "./rules/no-label-slot-in-checkbox";
2-
3-
export const rules = {
4-
"no-label-slot-in-checkbox": noLabelSlotInCheckbox
5-
};
1+
import { Linter } from "eslint";
2+
import rules from "./rules";
3+
import configs from "./configs"
64

75
const plugin = {
86
rules,
9-
configs: {
10-
recommended: {
11-
plugins: ["@dnn-community/eslint-plugin"],
12-
rules: {
13-
"@dnn-community/no-label-slot-in-checkbox": "error"
14-
}
15-
}
16-
}
7+
configs,
8+
};
9+
10+
const flatRecommended: Linter.FlatConfig = {
11+
plugins: {
12+
"@dnn-elements": plugin,
13+
},
14+
rules: configs.recommended.rules,
15+
};
16+
17+
configs.flat = {
18+
recommended: flatRecommended,
1719
}
1820

1921
export default plugin;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { noLabelSlotInCheckbox } from "./no-label-slot-in-checkbox";
2+
3+
export default {
4+
"no-label-slot-in-checkbox": noLabelSlotInCheckbox,
5+
}

0 commit comments

Comments
 (0)