forked from nrwl/nx
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(linter): add support for workspace rules (nrwl#6859)
* feat(linter): add support for workspace rules * chore(linter): move deps to correct package * feat(linter): workspace-lint-rules as project with test target * chore(linter): tiny clean up * fix(linter): update generators.json after refactor * chore(linter): implement e2e test and PR feedback * docs(linter): update generator docs * docs(linter): update generator docs * docs(linter): update generator docs
- Loading branch information
1 parent
7a517a1
commit ded0692
Showing
28 changed files
with
1,409 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# @nrwl/linter:workspace-rule | ||
|
||
Create a new workspace ESLint rule | ||
|
||
## Usage | ||
|
||
```bash | ||
nx generate workspace-rule ... | ||
``` | ||
|
||
By default, Nx will search for `workspace-rule` in the default collection provisioned in `angular.json`. | ||
|
||
You can specify the collection explicitly as follows: | ||
|
||
```bash | ||
nx g @nrwl/linter:workspace-rule ... | ||
``` | ||
|
||
Show what will be generated without writing to disk: | ||
|
||
```bash | ||
nx g workspace-rule ... --dry-run | ||
``` | ||
|
||
### Examples | ||
|
||
Create a new workspace lint rule called my-custom-rule: | ||
|
||
```bash | ||
nx g @nrwl/linter:workspace-rule my-custom-rule | ||
``` | ||
|
||
Create a new workspace lint rule located at tools/eslint-rules/a/b/c/my-custom-rule.ts: | ||
|
||
```bash | ||
nx g @nrwl/linter:workspace-rule --name=my-custom-rule --directory=a/b/c | ||
``` | ||
|
||
## Options | ||
|
||
### directory (_**required**_) | ||
|
||
Alias(es): dir | ||
|
||
Default: `rules` | ||
|
||
Type: `string` | ||
|
||
Create the rule under this directory within tools/eslint-rules/ (can be nested). | ||
|
||
### name (_**required**_) | ||
|
||
Type: `string` | ||
|
||
The name of the new rule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"express", | ||
"gatsby", | ||
"jest", | ||
"linter", | ||
"nest", | ||
"next", | ||
"node", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# @nrwl/linter:workspace-rule | ||
|
||
Create a new workspace ESLint rule | ||
|
||
## Usage | ||
|
||
```bash | ||
nx generate workspace-rule ... | ||
``` | ||
|
||
By default, Nx will search for `workspace-rule` in the default collection provisioned in `workspace.json`. | ||
|
||
You can specify the collection explicitly as follows: | ||
|
||
```bash | ||
nx g @nrwl/linter:workspace-rule ... | ||
``` | ||
|
||
Show what will be generated without writing to disk: | ||
|
||
```bash | ||
nx g workspace-rule ... --dry-run | ||
``` | ||
|
||
### Examples | ||
|
||
Create a new workspace lint rule called my-custom-rule: | ||
|
||
```bash | ||
nx g @nrwl/linter:workspace-rule my-custom-rule | ||
``` | ||
|
||
Create a new workspace lint rule located at tools/eslint-rules/a/b/c/my-custom-rule.ts: | ||
|
||
```bash | ||
nx g @nrwl/linter:workspace-rule --name=my-custom-rule --directory=a/b/c | ||
``` | ||
|
||
## Options | ||
|
||
### directory (_**required**_) | ||
|
||
Alias(es): dir | ||
|
||
Default: `rules` | ||
|
||
Type: `string` | ||
|
||
Create the rule under this directory within tools/eslint-rules/ (can be nested). | ||
|
||
### name (_**required**_) | ||
|
||
Type: `string` | ||
|
||
The name of the new rule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"express", | ||
"gatsby", | ||
"jest", | ||
"linter", | ||
"nest", | ||
"next", | ||
"node", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# @nrwl/linter:workspace-rule | ||
|
||
Create a new workspace ESLint rule | ||
|
||
## Usage | ||
|
||
```bash | ||
nx generate workspace-rule ... | ||
``` | ||
|
||
By default, Nx will search for `workspace-rule` in the default collection provisioned in `workspace.json`. | ||
|
||
You can specify the collection explicitly as follows: | ||
|
||
```bash | ||
nx g @nrwl/linter:workspace-rule ... | ||
``` | ||
|
||
Show what will be generated without writing to disk: | ||
|
||
```bash | ||
nx g workspace-rule ... --dry-run | ||
``` | ||
|
||
### Examples | ||
|
||
Create a new workspace lint rule called my-custom-rule: | ||
|
||
```bash | ||
nx g @nrwl/linter:workspace-rule my-custom-rule | ||
``` | ||
|
||
Create a new workspace lint rule located at tools/eslint-rules/a/b/c/my-custom-rule.ts: | ||
|
||
```bash | ||
nx g @nrwl/linter:workspace-rule --name=my-custom-rule --directory=a/b/c | ||
``` | ||
|
||
## Options | ||
|
||
### directory (_**required**_) | ||
|
||
Alias(es): dir | ||
|
||
Default: `rules` | ||
|
||
Type: `string` | ||
|
||
Create the rule under this directory within tools/eslint-rules/ (can be nested). | ||
|
||
### name (_**required**_) | ||
|
||
Type: `string` | ||
|
||
The name of the new rule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"express", | ||
"gatsby", | ||
"jest", | ||
"linter", | ||
"nest", | ||
"next", | ||
"node", | ||
|
Oops, something went wrong.