2016-03-28 14:25:22 -07:00
|
|
|
{
|
2016-10-27 20:48:47 +02:00
|
|
|
"rulesDirectory": [
|
2021-07-06 19:41:48 +02:00
|
|
|
"tools/tslint",
|
2021-08-05 16:56:46 -07:00
|
|
|
"node_modules/@angular/dev-infra-private/tslint-rules",
|
2016-12-08 13:46:08 -08:00
|
|
|
"node_modules/vrsource-tslint-rules/rules",
|
2019-05-02 16:44:24 +01:00
|
|
|
"node_modules/tslint-eslint-rules/dist/rules",
|
|
|
|
|
"node_modules/tslint-no-toplevel-property-access/rules"
|
2016-10-27 20:48:47 +02:00
|
|
|
],
|
|
|
|
|
"rules": {
|
2021-07-06 19:41:48 +02:00
|
|
|
// The first rule needs to be `ts-node-loader` which sets up `ts-node` within TSLint so
|
|
|
|
|
// that rules written in TypeScript can be loaded without needing to be transpiled.
|
|
|
|
|
"ts-node-loader": true,
|
|
|
|
|
// Custom rules written in TypeScript.
|
|
|
|
|
"require-internal-with-underscore": true,
|
|
|
|
|
"no-implicit-override-abstract": true,
|
2021-09-25 14:58:32 +02:00
|
|
|
"validate-import-for-esm-cjs-interop": [true, {
|
|
|
|
|
// The following CommonJS modules have type definitions that suggest the existence of
|
|
|
|
|
// named exports. This is not true at runtime when imported from an ES module (because
|
|
|
|
|
// the ESM interop only exposes statically-discoverable named exports). Instead
|
|
|
|
|
// default imports should be used to ensure compatibility with both ESM or CommonJS.
|
|
|
|
|
"noNamedExports": ["typescript", "minimist", "magic-string", "semver", "yargs", "glob", "cluster", "convert-source-map"],
|
|
|
|
|
// The following CommonJS modules appear to have a default export available (due to the `esModuleInterop` flag),
|
|
|
|
|
// but at runtime with CJS (e.g. for devmode output/tests) there is no default export as these modules set
|
|
|
|
|
// `__esModule`. This does not match with what happens in ESM NodeJS runtime where NodeJS exposes
|
|
|
|
|
// `module.exports` as `export default`. Instead, named exports should be used for compat with CJS/ESM.
|
|
|
|
|
"noDefaultExport": [],
|
|
|
|
|
// List of modules which are incompatible and should never be imported at all.
|
|
|
|
|
"incompatibleModules": {
|
|
|
|
|
// `@babel/core` and `@babel/types` suggest named exports which do not exist at runtime within ESM
|
|
|
|
|
// (as these named exports are not statically discoverable by NodeJS). At the same time, these modules
|
|
|
|
|
// set `__esModule` and the default import does not exist for CJS at runtime (e.g. breaking tests).
|
|
|
|
|
"@babel/core": "This module is incompatible with the ESM/CJS interop. Use the custom interop file.",
|
|
|
|
|
"@babel/types": "This module is incompatible with the ESM/CJS interop. Use the custom interop file and import the `types` namespace."
|
|
|
|
|
}
|
|
|
|
|
}],
|
2021-06-04 16:57:07 +02:00
|
|
|
"eofline": true,
|
2018-08-16 15:55:45 -07:00
|
|
|
"file-header": [
|
|
|
|
|
true,
|
2020-05-19 12:07:26 -07:00
|
|
|
{
|
|
|
|
|
"match": "Copyright Google LLC",
|
|
|
|
|
"allow-single-line-comments": false
|
|
|
|
|
}
|
2018-08-16 15:55:45 -07:00
|
|
|
],
|
|
|
|
|
"no-console": [
|
|
|
|
|
true,
|
|
|
|
|
"log"
|
|
|
|
|
],
|
2019-10-17 01:52:48 +02:00
|
|
|
"no-construct": true,
|
2016-10-27 20:48:47 +02:00
|
|
|
"no-duplicate-imports": true,
|
|
|
|
|
"no-duplicate-variable": true,
|
2016-11-12 14:14:20 +01:00
|
|
|
"no-var-keyword": true,
|
2019-10-17 02:46:50 +02:00
|
|
|
"prefer-literal": [
|
|
|
|
|
true,
|
|
|
|
|
"object"
|
|
|
|
|
],
|
2019-05-02 16:44:24 +01:00
|
|
|
"no-toplevel-property-access": [
|
|
|
|
|
true,
|
|
|
|
|
"packages/animations/src/",
|
|
|
|
|
"packages/animations/browser/",
|
|
|
|
|
"packages/common/src/",
|
|
|
|
|
"packages/core/src/",
|
|
|
|
|
"packages/elements/src/",
|
|
|
|
|
"packages/forms/src/",
|
|
|
|
|
"packages/platform-browser/src/",
|
|
|
|
|
"packages/router/src/"
|
|
|
|
|
],
|
2018-08-16 15:55:45 -07:00
|
|
|
"semicolon": [
|
|
|
|
|
true
|
|
|
|
|
],
|
|
|
|
|
"variable-name": [
|
|
|
|
|
true,
|
|
|
|
|
"ban-keywords"
|
|
|
|
|
],
|
|
|
|
|
"no-inner-declarations": [
|
|
|
|
|
true,
|
|
|
|
|
"function"
|
|
|
|
|
],
|
2021-05-29 13:25:53 +02:00
|
|
|
"no-debugger": true,
|
|
|
|
|
"ban": [
|
|
|
|
|
true,
|
|
|
|
|
{"name": "fdescribe", "message": "Don't keep jasmine focus methods."},
|
|
|
|
|
{"name": "fit", "message": "Don't keep jasmine focus methods."}
|
|
|
|
|
]
|
2017-09-22 19:51:03 +02:00
|
|
|
},
|
|
|
|
|
"jsRules": {
|
2021-07-06 19:41:48 +02:00
|
|
|
// The first rule needs to be `ts-node-loader` which sets up `ts-node` within TSLint so
|
|
|
|
|
// that rules written in TypeScript can be loaded without needing to be transpiled.
|
|
|
|
|
"ts-node-loader": true,
|
|
|
|
|
// Custom rules written in TypeScript.
|
|
|
|
|
"require-internal-with-underscore": true,
|
|
|
|
|
|
2021-06-04 16:57:07 +02:00
|
|
|
"eofline": true,
|
2018-08-16 15:55:45 -07:00
|
|
|
"file-header": [
|
|
|
|
|
true,
|
2020-05-19 12:07:26 -07:00
|
|
|
{
|
|
|
|
|
"match": "Copyright Google LLC",
|
|
|
|
|
"allow-single-line-comments": false
|
|
|
|
|
}
|
2018-08-16 15:55:45 -07:00
|
|
|
],
|
|
|
|
|
"no-console": [
|
|
|
|
|
true,
|
|
|
|
|
"log"
|
|
|
|
|
],
|
2017-09-22 19:51:03 +02:00
|
|
|
"no-duplicate-imports": true,
|
|
|
|
|
"no-duplicate-variable": true,
|
2018-08-16 15:55:45 -07:00
|
|
|
"semicolon": [
|
|
|
|
|
true
|
|
|
|
|
],
|
|
|
|
|
"variable-name": [
|
|
|
|
|
true,
|
|
|
|
|
"ban-keywords"
|
|
|
|
|
],
|
|
|
|
|
"no-inner-declarations": [
|
|
|
|
|
true,
|
|
|
|
|
"function"
|
2021-05-29 13:25:53 +02:00
|
|
|
],
|
|
|
|
|
"ban": [
|
|
|
|
|
true,
|
|
|
|
|
{"name": "fdescribe", "message": "Don't keep jasmine focus methods."},
|
|
|
|
|
{"name": "fit", "message": "Don't keep jasmine focus methods."}
|
2018-08-16 15:55:45 -07:00
|
|
|
]
|
2020-03-02 18:35:30 +01:00
|
|
|
},
|
|
|
|
|
"linterOptions": {
|
|
|
|
|
"exclude": [
|
|
|
|
|
"**/node_modules/**/*",
|
|
|
|
|
// Ignore AIO and integration tests.
|
|
|
|
|
"./aio/**/*",
|
|
|
|
|
"./integration/**/*",
|
|
|
|
|
// Ignore output directories
|
|
|
|
|
"./built/**/*",
|
|
|
|
|
"./dist/**/*",
|
|
|
|
|
"./bazel-out/**/*",
|
|
|
|
|
// Ignore special files
|
|
|
|
|
"**/*.externs.js",
|
|
|
|
|
// Ignore test files
|
2020-11-11 15:29:43 +00:00
|
|
|
"./packages/compiler-cli/test/compliance/test_cases/**/*",
|
2020-03-02 18:35:30 +01:00
|
|
|
"./packages/localize/**/test_files/**/*",
|
|
|
|
|
"./tools/public_api_guard/**/*.d.ts",
|
|
|
|
|
"./modules/benchmarks_external/**/*",
|
|
|
|
|
// Ignore zone.js directory
|
|
|
|
|
// TODO(JiaLiPassion): add zone.js back later
|
2021-08-05 16:56:46 -07:00
|
|
|
"./packages/zone.js/**/*"
|
2020-03-02 18:35:30 +01:00
|
|
|
]
|
2016-10-27 20:48:47 +02:00
|
|
|
}
|
2019-05-02 16:44:24 +01:00
|
|
|
}
|