nx/docs/generated/packages/eslint/generators/workspace-rule.json
2023-10-19 18:07:12 -04:00

35 lines
1.7 KiB
JSON

{
"name": "workspace-rule",
"factory": "./src/generators/workspace-rule/workspace-rule#lintWorkspaceRuleGenerator",
"schema": {
"$schema": "http://json-schema.org/schema",
"$id": "NxWorkspaceRule",
"cli": "nx",
"title": "Create a new Workspace Lint Rule",
"description": "Create a new Workspace Lint Rule.",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the new rule.",
"$default": { "$source": "argv", "index": 0 }
},
"directory": {
"type": "string",
"description": "Create the rule under this directory within `tools/eslint-rules/` (can be nested).",
"alias": "dir",
"default": "rules"
}
},
"required": ["name", "directory"],
"examplesFile": "{% tabs %}\n{% tab label=\"Create rule\" %}\n\nThis command will generate a new workspace lint rule called `my-custom-rule`. The new rule will be generated in `tools/eslint-rules/rules` folder:\n\n```shell\nnx g @nx/eslint:workspace-rule my-custom-rule\n```\n\n{% /tab %}\n{% tab label=\"Custom sub-folder\" %}\n\nWe can change the default sub-folder from `rules` and specify a custom one:\n\n```shell\nnx g @nx/eslint:workspace-rule --name=my-custom-rule --directory=my/custom/path\n```\n\nThe command above will generate the rule in `tools/eslint-rules/my/custom/path` folder.\n\n{% /tab %}\n{% /tabs %}\n\n---\n",
"presets": []
},
"description": "Create a new Workspace ESLint rule.",
"implementation": "/packages/eslint/src/generators/workspace-rule/workspace-rule#lintWorkspaceRuleGenerator.ts",
"aliases": [],
"hidden": false,
"path": "/packages/eslint/src/generators/workspace-rule/schema.json",
"type": "generator"
}