315 lines
11 KiB
JSON
315 lines
11 KiB
JSON
{
|
|
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
|
"name": "linter",
|
|
"description": "The Linter plugin contains executors, generator, plugin and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
|
|
"root": "/packages/linter",
|
|
"source": "/packages/linter/src",
|
|
"generators": [
|
|
{
|
|
"name": "workspace-rules-project",
|
|
"factory": "./src/generators/workspace-rules-project/workspace-rules-project#lintWorkspaceRulesProjectGenerator",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"$id": "NxWorkspaceRulesProject",
|
|
"cli": "nx",
|
|
"title": "Create the Workspace Lint Rules Project",
|
|
"description": "Create the Workspace Lint Rules Project.",
|
|
"type": "object",
|
|
"examples": [
|
|
{
|
|
"command": "nx g @nrwl/linter:workspace-rules-project",
|
|
"description": "Create the Workspace Lint Rules Project"
|
|
}
|
|
],
|
|
"properties": {},
|
|
"required": [],
|
|
"presets": []
|
|
},
|
|
"description": "Create the Workspace Lint Rules Project.",
|
|
"hidden": true,
|
|
"implementation": "/packages/linter/src/generators/workspace-rules-project/workspace-rules-project#lintWorkspaceRulesProjectGenerator.ts",
|
|
"aliases": [],
|
|
"path": "/packages/linter/src/generators/workspace-rules-project/schema.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",
|
|
"examples": [
|
|
{
|
|
"command": "nx g @nrwl/linter:workspace-rule my-custom-rule",
|
|
"description": "Create a new workspace lint rule called my-custom-rule"
|
|
},
|
|
{
|
|
"command": "nx g @nrwl/linter:workspace-rule --name=my-custom-rule --directory=a/b/c",
|
|
"description": "Create a new workspace lint rule located at `tools/eslint-rules/a/b/c/my-custom-rule.ts`"
|
|
}
|
|
],
|
|
"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"],
|
|
"presets": []
|
|
},
|
|
"description": "Create a new Workspace ESLint rule.",
|
|
"implementation": "/packages/linter/src/generators/workspace-rule/workspace-rule#lintWorkspaceRuleGenerator.ts",
|
|
"aliases": [],
|
|
"hidden": false,
|
|
"path": "/packages/linter/src/generators/workspace-rule/schema.json"
|
|
}
|
|
],
|
|
"executors": [
|
|
{
|
|
"name": "lint",
|
|
"implementation": "/packages/linter/src/executors/lint/lint.impl.ts",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"title": "Lint Target",
|
|
"description": "Linter.",
|
|
"cli": "nx",
|
|
"type": "object",
|
|
"properties": {
|
|
"linter": {
|
|
"description": "The tool to use for running lint checks.",
|
|
"type": "string",
|
|
"enum": ["eslint", "tslint"],
|
|
"default": "eslint"
|
|
},
|
|
"config": {
|
|
"type": "string",
|
|
"description": "The name of the configuration file."
|
|
},
|
|
"tsConfig": {
|
|
"description": "The name of the TypeScript configuration file.",
|
|
"oneOf": [
|
|
{ "type": "string" },
|
|
{ "type": "array", "items": { "type": "string" } }
|
|
]
|
|
},
|
|
"format": {
|
|
"type": "string",
|
|
"description": "ESLint Output formatter (https://eslint.org/docs/user-guide/formatters).",
|
|
"default": "stylish",
|
|
"anyOf": [
|
|
{
|
|
"enum": [
|
|
"stylish",
|
|
"compact",
|
|
"codeframe",
|
|
"unix",
|
|
"visualstudio",
|
|
"table",
|
|
"checkstyle",
|
|
"html",
|
|
"jslint-xml",
|
|
"json",
|
|
"json-with-metadata",
|
|
"junit",
|
|
"tap"
|
|
]
|
|
},
|
|
{ "minLength": 1 }
|
|
]
|
|
},
|
|
"exclude": {
|
|
"type": "array",
|
|
"description": "Files to exclude from linting.",
|
|
"default": [],
|
|
"items": { "type": "string" }
|
|
},
|
|
"files": {
|
|
"type": "array",
|
|
"description": "Files to include in linting.",
|
|
"default": [],
|
|
"items": { "type": "string" }
|
|
},
|
|
"force": {
|
|
"type": "boolean",
|
|
"description": "Succeeds even if there was linting errors.",
|
|
"default": false
|
|
},
|
|
"silent": {
|
|
"type": "boolean",
|
|
"description": "Hide output text.",
|
|
"default": false
|
|
},
|
|
"fix": {
|
|
"type": "boolean",
|
|
"description": "Fixes linting errors (may overwrite linted files).",
|
|
"default": false
|
|
},
|
|
"cache": {
|
|
"type": "boolean",
|
|
"description": "Only check changed files.",
|
|
"default": false
|
|
},
|
|
"cacheLocation": {
|
|
"type": "string",
|
|
"description": "Path to the cache file or directory."
|
|
},
|
|
"outputFile": {
|
|
"type": "string",
|
|
"description": "File to write report to."
|
|
},
|
|
"maxWarnings": {
|
|
"type": "number",
|
|
"description": "Number of warnings to trigger nonzero exit code - default: `-1`.",
|
|
"default": -1
|
|
},
|
|
"quiet": {
|
|
"type": "boolean",
|
|
"description": "Report errors only - default: `false`.",
|
|
"default": false
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": ["linter"],
|
|
"presets": []
|
|
},
|
|
"description": "**[DEPRECATED]**: Please use the eslint builder instead, an automated migration was provided in `v10.3.0`.",
|
|
"aliases": [],
|
|
"hidden": false,
|
|
"path": "/packages/linter/src/executors/lint/schema.json"
|
|
},
|
|
{
|
|
"name": "eslint",
|
|
"implementation": "/packages/linter/src/executors/eslint/lint.impl.ts",
|
|
"schema": {
|
|
"$schema": "http://json-schema.org/schema",
|
|
"title": "ESLint Lint Target",
|
|
"description": "ESLint Lint Target.",
|
|
"cli": "nx",
|
|
"type": "object",
|
|
"properties": {
|
|
"eslintConfig": {
|
|
"type": "string",
|
|
"description": "The name of the ESLint configuration file."
|
|
},
|
|
"lintFilePatterns": {
|
|
"type": "array",
|
|
"description": "One or more files/dirs/globs to pass directly to ESLint's `lintFiles()` method.",
|
|
"default": [],
|
|
"items": { "type": "string" }
|
|
},
|
|
"format": {
|
|
"type": "string",
|
|
"description": "ESLint Output formatter (https://eslint.org/docs/user-guide/formatters).",
|
|
"default": "stylish",
|
|
"anyOf": [
|
|
{
|
|
"enum": [
|
|
"stylish",
|
|
"compact",
|
|
"codeframe",
|
|
"unix",
|
|
"visualstudio",
|
|
"table",
|
|
"checkstyle",
|
|
"html",
|
|
"jslint-xml",
|
|
"json",
|
|
"json-with-metadata",
|
|
"junit",
|
|
"tap"
|
|
]
|
|
},
|
|
{ "minLength": 1 }
|
|
]
|
|
},
|
|
"force": {
|
|
"type": "boolean",
|
|
"description": "Succeeds even if there was linting errors.",
|
|
"default": false
|
|
},
|
|
"silent": {
|
|
"type": "boolean",
|
|
"description": "Hide output text.",
|
|
"default": false
|
|
},
|
|
"fix": {
|
|
"type": "boolean",
|
|
"description": "Fixes linting errors (may overwrite linted files).",
|
|
"default": false
|
|
},
|
|
"cache": {
|
|
"type": "boolean",
|
|
"description": "Only check changed files.",
|
|
"default": false
|
|
},
|
|
"cacheLocation": {
|
|
"type": "string",
|
|
"description": "Path to the cache file or directory."
|
|
},
|
|
"outputFile": {
|
|
"type": "string",
|
|
"description": "File to write report to."
|
|
},
|
|
"maxWarnings": {
|
|
"type": "number",
|
|
"description": "Number of warnings to trigger nonzero exit code - default: `-1`.",
|
|
"default": -1
|
|
},
|
|
"quiet": {
|
|
"type": "boolean",
|
|
"description": "Report errors only - default: `false`.",
|
|
"default": false
|
|
},
|
|
"ignorePath": {
|
|
"type": "string",
|
|
"description": "The path of the `.eslintignore` file."
|
|
},
|
|
"noEslintrc": {
|
|
"type": "boolean",
|
|
"description": "The equivalent of the `--no-eslintrc` flag on the ESLint CLI, it is `false` by default.",
|
|
"default": false
|
|
},
|
|
"hasTypeAwareRules": {
|
|
"type": "boolean",
|
|
"description": "When set to `true`, the linter will invalidate its cache when any of its dependencies changes."
|
|
},
|
|
"cacheStrategy": {
|
|
"type": "string",
|
|
"description": "Strategy to use for detecting changed files in the cache.",
|
|
"default": "metadata",
|
|
"enum": ["metadata", "content"]
|
|
},
|
|
"rulesdir": {
|
|
"type": "array",
|
|
"description": "The equivalent of the `--rulesdir` flag on the ESLint CLI.",
|
|
"default": [],
|
|
"items": { "type": "string" }
|
|
},
|
|
"resolvePluginsRelativeTo": {
|
|
"type": "string",
|
|
"description": "The equivalent of the `--resolve-plugins-relative-to` flag on the ESLint CLI."
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": ["lintFilePatterns"],
|
|
"presets": []
|
|
},
|
|
"hasher": "./src/executors/eslint/hasher",
|
|
"description": "Run ESLint on a project.",
|
|
"aliases": [],
|
|
"hidden": false,
|
|
"path": "/packages/linter/src/executors/eslint/schema.json"
|
|
}
|
|
]
|
|
}
|