Skip to content

Commit ae0041b

Browse files
feat(eslint-plugin): add NgRx ESLint Plugin (ngrx#3373)
* feat(eslint-plugin): add NgRx ESLint Plugin * feat: add eslint-plugin to update groups
1 parent 7fd8477 commit ae0041b

File tree

157 files changed

+10860
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+10860
-94
lines changed

.eslintrc.json

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -42,66 +42,7 @@
4242
"caughtErrorsIgnorePattern": "^_"
4343
}
4444
],
45-
"@typescript-eslint/naming-convention": [
46-
"warn",
47-
{
48-
"selector": "default",
49-
"format": ["camelCase"],
50-
"leadingUnderscore": "allow"
51-
},
52-
{
53-
"selector": "property",
54-
"format": ["camelCase", "UPPER_CASE"],
55-
"leadingUnderscore": "allow"
56-
},
57-
{
58-
"selector": "enum",
59-
"format": ["PascalCase"]
60-
},
61-
{
62-
"selector": "enumMember",
63-
"format": ["PascalCase", "UPPER_CASE"]
64-
},
65-
{
66-
"selector": "typeParameter",
67-
"format": ["PascalCase"]
68-
},
69-
{
70-
"selector": "typeAlias",
71-
"format": ["PascalCase"]
72-
},
73-
{
74-
"selector": "interface",
75-
"format": ["PascalCase"]
76-
},
77-
{
78-
"selector": "classProperty",
79-
"format": ["camelCase", "PascalCase", "UPPER_CASE"],
80-
"leadingUnderscore": "allow"
81-
},
82-
{
83-
"selector": "class",
84-
"format": ["PascalCase"]
85-
},
86-
{
87-
"selector": "variable",
88-
"format": ["camelCase", "PascalCase", "UPPER_CASE"],
89-
"leadingUnderscore": "allow"
90-
},
91-
{
92-
"selector": "objectLiteralMethod",
93-
"format": ["camelCase", "PascalCase", "UPPER_CASE"]
94-
},
95-
{
96-
"selector": "objectLiteralProperty",
97-
"format": ["camelCase", "PascalCase", "UPPER_CASE"]
98-
},
99-
{
100-
"selector": "function",
101-
"format": ["camelCase", "PascalCase"],
102-
"leadingUnderscore": "allow"
103-
}
104-
],
45+
"@typescript-eslint/naming-convention": "off",
10546
"@typescript-eslint/prefer-namespace-keyword": "error",
10647
// because we're using object
10748
"@typescript-eslint/ban-types": "warn",

angular.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,83 @@
440440
"schematics": {},
441441
"tags": []
442442
},
443+
"eslint-plugin": {
444+
"root": "modules/eslint-plugin",
445+
"sourceRoot": "modules/eslint-plugin/src",
446+
"projectType": "library",
447+
"schematics": {},
448+
"architect": {
449+
"lint": {
450+
"builder": "@nrwl/linter:eslint",
451+
"options": {
452+
"lintFilePatterns": [
453+
"modules/eslint-plugin/*/**/*.ts",
454+
"modules/eslint-plugin/*/**/*.html"
455+
]
456+
},
457+
"outputs": ["{options.outputFile}"]
458+
},
459+
"test": {
460+
"builder": "@nrwl/jest:jest",
461+
"options": {
462+
"jestConfig": "modules/eslint-plugin/jest.config.js",
463+
"runInBand": true
464+
},
465+
"outputs": ["coverage/modules/eslint-plugin"]
466+
},
467+
"build-package": {
468+
"builder": "@nrwl/js:tsc",
469+
"options": {
470+
"outputPath": "dist/modules/eslint-plugin",
471+
"tsConfig": "modules/eslint-plugin/tsconfig.build.json",
472+
"packageJson": "modules/eslint-plugin/package.json",
473+
"main": "modules/eslint-plugin/src/index.ts",
474+
"sourceMap": false,
475+
"assets": [
476+
"collection.json",
477+
{
478+
"input": "./modules/eslint-plugin/src",
479+
"glob": "**/*.!(ts)",
480+
"output": "./src"
481+
},
482+
{
483+
"input": "./modules/eslint-plugin",
484+
"glob": "collection.json",
485+
"output": "."
486+
}
487+
],
488+
"srcRootForCompilationRoot": "modules/eslint-plugin"
489+
},
490+
"outputs": ["{options.outputPath}"]
491+
},
492+
"build": {
493+
"builder": "@nrwl/workspace:run-commands",
494+
"options": {
495+
"parallel": false,
496+
"commands": [
497+
{
498+
"command": "nx build-package eslint-plugin"
499+
},
500+
// uncomment when there are eslint-plugin migrations
501+
// {
502+
// "command": "yarn tsc -p modules/eslint-plugin/tsconfig.schematics.json"
503+
// },
504+
{
505+
"command": "cpy modules/eslint-plugin/migrations/migration.json dist/modules/eslint-plugin/migrations"
506+
},
507+
{
508+
"command": "cpy modules/eslint-plugin/schematics/collection.json dist/modules/eslint-plugin/schematics"
509+
},
510+
{
511+
"command": "cpy modules/eslint-plugin/schematics/ng-add/schema.json dist/modules/eslint-plugin/schematics/ng-add"
512+
}
513+
],
514+
"outputPath": ["dist/modules/eslint-plugin"]
515+
}
516+
}
517+
},
518+
"tags": []
519+
},
443520
"example-app": {
444521
"root": "projects/example-app",
445522
"sourceRoot": "projects/example-app/src",

modules/component-store/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"@ngrx/schematics",
3838
"@ngrx/store-devtools",
3939
"@ngrx/component-store",
40-
"@ngrx/component"
40+
"@ngrx/component",
41+
"@ngrx/eslint-plugin"
4142
],
4243
"migrations": "./migrations/migration.json"
4344
},

modules/component/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"@ngrx/schematics",
3737
"@ngrx/store-devtools",
3838
"@ngrx/component-store",
39-
"@ngrx/component"
39+
"@ngrx/component",
40+
"@ngrx/eslint-plugin"
4041
],
4142
"migrations": "./migrations/migration.json"
4243
},

modules/component/src/let/let.directive.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export interface LetViewContext<T> {
9191
*/
9292
@Directive({ selector: '[ngrxLet]' })
9393
export class LetDirective<U> implements OnDestroy {
94-
// eslint-disable-next-line @typescript-eslint/naming-convention
9594
static ngTemplateGuard_ngrxLet: 'binding';
9695

9796
private isEmbeddedViewCreated = false;

modules/data/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"@ngrx/schematics",
3939
"@ngrx/store-devtools",
4040
"@ngrx/component-store",
41-
"@ngrx/component"
41+
"@ngrx/component",
42+
"@ngrx/eslint-plugin"
4243
],
4344
"migrations": "./migrations/migration.json"
4445
},

modules/effects/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"@ngrx/schematics",
3737
"@ngrx/store-devtools",
3838
"@ngrx/component-store",
39-
"@ngrx/component"
39+
"@ngrx/component",
40+
"@ngrx/eslint-plugin"
4041
],
4142
"migrations": "./migrations/migration.json"
4243
},

modules/entity/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"@ngrx/schematics",
3636
"@ngrx/store-devtools",
3737
"@ngrx/component-store",
38-
"@ngrx/component"
38+
"@ngrx/component",
39+
"@ngrx/eslint-plugin"
3940
],
4041
"migrations": "./migrations/migration.json"
4142
},

modules/eslint-plugin/.eslintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"]
4+
}

modules/eslint-plugin/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Change Log
2+
3+
See [CHANGELOG.md](https://github.com/ngrx/platform/blob/master/CHANGELOG.md)

0 commit comments

Comments
 (0)