Skip to content

Commit a981df4

Browse files
committed
chore(repo): convert eslint flat config
1 parent 532f786 commit a981df4

26 files changed

+778
-501
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 53 deletions
This file was deleted.

apps/ionic-app/.eslintrc.json

Lines changed: 0 additions & 41 deletions
This file was deleted.

apps/ionic-app/eslint.config.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const { FlatCompat } = require('@eslint/eslintrc');
2+
const js = require('@eslint/js');
3+
const baseConfig = require('../../eslint.config.js');
4+
5+
const compat = new FlatCompat({
6+
baseDirectory: __dirname,
7+
recommendedConfig: js.configs.recommended,
8+
});
9+
10+
module.exports = [
11+
...baseConfig,
12+
...compat
13+
.config({
14+
extends: ['plugin:@nx/angular', 'plugin:@angular-eslint/template/process-inline-templates'],
15+
})
16+
.map((config) => ({
17+
...config,
18+
files: ['**/*.ts'],
19+
rules: {
20+
...config.rules,
21+
'@angular-eslint/directive-selector': [
22+
'error',
23+
{
24+
type: 'attribute',
25+
prefix: 'platform',
26+
style: 'camelCase',
27+
},
28+
],
29+
'@angular-eslint/component-selector': [
30+
'error',
31+
{
32+
type: 'element',
33+
prefix: 'platform',
34+
style: 'kebab-case',
35+
},
36+
],
37+
'@angular-eslint/component-class-suffix': [
38+
'error',
39+
{
40+
suffixes: ['Page', 'Component'],
41+
},
42+
],
43+
'@angular-eslint/no-empty-lifecycle-method': 0,
44+
'@typescript-eslint/no-empty-function': 0,
45+
},
46+
})),
47+
...compat
48+
.config({
49+
extends: ['plugin:@nx/angular-template'],
50+
})
51+
.map((config) => ({
52+
...config,
53+
files: ['**/*.html'],
54+
rules: {
55+
...config.rules,
56+
},
57+
})),
58+
];

apps/kitchen-sink/.eslintrc.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

apps/kitchen-sink/eslint.config.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
const { FlatCompat } = require('@eslint/eslintrc');
2+
const js = require('@eslint/js');
3+
const baseConfig = require('../../eslint.config.js');
4+
5+
const compat = new FlatCompat({
6+
baseDirectory: __dirname,
7+
recommendedConfig: js.configs.recommended,
8+
});
9+
10+
module.exports = [
11+
...baseConfig,
12+
...compat
13+
.config({
14+
extends: ['plugin:@nx/angular', 'plugin:@angular-eslint/template/process-inline-templates'],
15+
})
16+
.map((config) => ({
17+
...config,
18+
files: ['**/*.ts'],
19+
rules: {
20+
...config.rules,
21+
'@angular-eslint/directive-selector': [
22+
'error',
23+
{
24+
type: 'attribute',
25+
prefix: 'app',
26+
style: 'camelCase',
27+
},
28+
],
29+
'@angular-eslint/component-selector': [
30+
'error',
31+
{
32+
type: 'element',
33+
prefix: 'app',
34+
style: 'kebab-case',
35+
},
36+
],
37+
},
38+
})),
39+
...compat
40+
.config({
41+
extends: ['plugin:@nx/angular-template'],
42+
})
43+
.map((config) => ({
44+
...config,
45+
files: ['**/*.html'],
46+
rules: {
47+
...config.rules,
48+
},
49+
})),
50+
];

apps/kitchen-sink/project.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
],
2323
"styles": ["apps/kitchen-sink/src/styles.css"],
2424
"scripts": [],
25-
"loader": {
26-
".blob": "file"
27-
}
25+
"loader": {
26+
".blob": "file"
27+
}
2828
},
2929
"configurations": {
3030
"production": {
@@ -40,7 +40,10 @@
4040
"maximumError": "4kb"
4141
}
4242
],
43-
"externalDependencies": ["three/examples/jsm/utils/BufferGeometryUtils", "three/examples/jsm/postprocessing/Pass"],
43+
"externalDependencies": [
44+
"three/examples/jsm/utils/BufferGeometryUtils",
45+
"three/examples/jsm/postprocessing/Pass"
46+
],
4447
"outputHashing": "all"
4548
},
4649
"development": {

eslint.config.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
const { FlatCompat } = require('@eslint/eslintrc');
2+
const js = require('@eslint/js');
3+
const nxEslintPlugin = require('@nx/eslint-plugin');
4+
5+
const compat = new FlatCompat({
6+
baseDirectory: __dirname,
7+
recommendedConfig: js.configs.recommended,
8+
});
9+
10+
module.exports = [
11+
{ plugins: { '@nx': nxEslintPlugin } },
12+
{
13+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
14+
rules: {
15+
'@nx/enforce-module-boundaries': [
16+
'error',
17+
{
18+
enforceBuildableLibDependency: true,
19+
allow: [],
20+
depConstraints: [
21+
{
22+
sourceTag: '*',
23+
onlyDependOnLibsWithTags: ['*'],
24+
},
25+
],
26+
},
27+
],
28+
},
29+
},
30+
...compat
31+
.config({
32+
extends: ['plugin:@nx/typescript'],
33+
})
34+
.map((config) => ({
35+
...config,
36+
files: ['**/*.ts', '**/*.tsx'],
37+
rules: {
38+
...config.rules,
39+
'@typescript-eslint/no-extra-semi': 'error',
40+
'no-extra-semi': 'off',
41+
},
42+
})),
43+
...compat
44+
.config({
45+
extends: ['plugin:@nx/javascript'],
46+
})
47+
.map((config) => ({
48+
...config,
49+
files: ['**/*.js', '**/*.jsx'],
50+
rules: {
51+
...config.rules,
52+
'@typescript-eslint/no-extra-semi': 'error',
53+
'no-extra-semi': 'off',
54+
},
55+
})),
56+
...compat
57+
.config({
58+
env: {
59+
jest: true,
60+
},
61+
})
62+
.map((config) => ({
63+
...config,
64+
files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'],
65+
rules: {
66+
...config.rules,
67+
},
68+
})),
69+
{
70+
files: ['**/*.json'],
71+
// Override or add rules here
72+
rules: {},
73+
languageOptions: {
74+
parser: require('jsonc-eslint-parser'),
75+
},
76+
},
77+
];

libs/cannon/.eslintrc.json

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)