Skip to content

Commit 0982d8a

Browse files
committed
ci(lint): restore library project specific config rules
1 parent 706f78d commit 0982d8a

File tree

3 files changed

+61
-11
lines changed

3 files changed

+61
-11
lines changed

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@
213213
"lintFilePatterns": [
214214
"projects/igniteui-angular/**/*.ts",
215215
"projects/igniteui-angular/**/*.html"
216-
]
216+
],
217+
"eslintConfig": "projects/igniteui-angular/eslint.config.mjs"
217218
}
218219
},
219220
"cypress-run": {

eslint.config.mjs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ export default [{
3333
"@typescript-eslint": typescriptEslint,
3434
},
3535

36-
languageOptions: {
37-
ecmaVersion: 5,
38-
sourceType: "script",
39-
40-
parserOptions: {
41-
project: ["tsconfig.json"],
42-
createDefaultProgram: true,
43-
},
44-
},
45-
4636
rules: {
4737
"no-shadow": "off",
4838
"no-prototype-builtins": "off",
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { FlatCompat } from "@eslint/eslintrc";
2+
import js from "@eslint/js";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
import rootConfig from "../../eslint.config.mjs";
6+
// import tseslint from "typescript-eslint";
7+
// import angular from "angular-eslint";
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all
15+
});
16+
17+
export default [
18+
...rootConfig,
19+
{
20+
files: ["**/*.ts"],
21+
rules: {
22+
"@angular-eslint/component-selector": ["error", {
23+
type: "element",
24+
prefix: ["igx", "igc", "test"],
25+
style: "kebab-case",
26+
}],
27+
28+
"@angular-eslint/directive-selector": ["error", {
29+
type: ["attribute", "element"],
30+
prefix: ["igx", "igc"],
31+
}],
32+
33+
"@angular-eslint/no-input-rename": "off",
34+
"@typescript-eslint/consistent-type-definitions": "error",
35+
"@typescript-eslint/dot-notation": "off",
36+
"brace-style": ["error", "1tbs"],
37+
"id-blacklist": "off",
38+
"id-match": "off",
39+
"no-underscore-dangle": "off",
40+
41+
"no-restricted-syntax": ["error", {
42+
selector: "Decorator[expression.callee.name=HostBinding] Literal[value='attr.class']",
43+
message: "Do not use `attr.class` HostBinding in public-facing components",
44+
}],
45+
46+
"no-console": ["error", {
47+
allow: ["warn", "error"],
48+
}],
49+
50+
"no-debugger": "error",
51+
},
52+
},
53+
...compat.extends(
54+
"plugin:@angular-eslint/template/recommended",
55+
).map(config => ({
56+
...config,
57+
files: ["**/*.html"],
58+
}))
59+
];

0 commit comments

Comments
 (0)