2016-03-28 21:25:22 +00:00
{
2016-10-27 18:48:47 +00:00
"rulesDirectory" : [
2021-07-06 17:41:48 +00:00
"tools/tslint" ,
2016-12-08 21:46:08 +00:00
"node_modules/vrsource-tslint-rules/rules" ,
2019-05-02 15:44:24 +00:00
"node_modules/tslint-eslint-rules/dist/rules" ,
"node_modules/tslint-no-toplevel-property-access/rules"
2016-10-27 18:48:47 +00:00
] ,
"rules" : {
2021-07-06 17:41:48 +00: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.
2025-05-13 15:13:14 +00:00
"no-exported-inferred-call-type" : true ,
2025-08-29 16:03:43 +00:00
"no-duplicate-enum-values" : true ,
2021-07-06 17:41:48 +00:00
"require-internal-with-underscore" : true ,
"no-implicit-override-abstract" : true ,
2022-07-27 08:03:49 +00: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" : [
2022-12-14 12:25:25 +00:00
"typescript/lib/tsserverlibrary" ,
2022-07-27 08:03:49 +00:00
"typescript" ,
"minimist" ,
"magic-string" ,
"semver" ,
"yargs" ,
"glob" ,
"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.
2022-12-13 17:31:50 +00:00
"incompatibleModules" : { }
2021-09-25 12:58:32 +00:00
}
2022-07-27 08:03:49 +00:00
] ,
2021-06-04 14:57:07 +00:00
"eofline" : true ,
2018-08-16 22:55:45 +00:00
"file-header" : [
true ,
2020-05-19 19:07:26 +00:00
{
"match" : "Copyright Google LLC" ,
2021-12-10 02:37:01 +00:00
"allow-single-line-comments" : false ,
2024-09-20 15:23:15 +00:00
"default" : "@license\nCopyright Google LLC All Rights Reserved.\n\nUse of this source code is governed by an MIT-style license that can be\nfound in the LICENSE file at https://angular.dev/license"
2020-05-19 19:07:26 +00:00
}
2018-08-16 22:55:45 +00:00
] ,
2022-07-27 08:03:49 +00:00
"no-console" : [ true , "log" ] ,
2019-10-16 23:52:48 +00:00
"no-construct" : true ,
2016-10-27 18:48:47 +00:00
"no-duplicate-imports" : true ,
"no-duplicate-variable" : true ,
2016-11-12 13:14:20 +00:00
"no-var-keyword" : true ,
2022-07-27 08:03:49 +00:00
"prefer-literal" : [ true , "object" ] ,
2019-05-02 15:44:24 +00: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/"
] ,
2024-04-18 17:29:04 +00:00
"semicolon" : [ true , "always" , "ignore-bound-class-methods" ] ,
2022-07-27 08:03:49 +00:00
"variable-name" : [ true , "ban-keywords" ] ,
"no-inner-declarations" : [ true , "function" ] ,
2021-05-29 11:25:53 +00:00
"no-debugger" : true ,
"ban" : [
true ,
{ "name" : "fdescribe" , "message" : "Don't keep jasmine focus methods." } ,
2022-08-17 15:06:41 +00:00
{ "name" : "fit" , "message" : "Don't keep jasmine focus methods." } ,
2022-12-14 12:25:25 +00:00
{
"name" : [ "*" , "getMutableClone" ] ,
"message" : "Use a ts.factory.update* or ts.factory.create* method instead."
2023-11-03 13:12:44 +00:00
} ,
2025-05-13 15:13:14 +00:00
{
"name" : [ "performance" , "mark" ] ,
"message" : "`performance` methods aren't not fully supported in all environments like JSDOM and Cloudflare workers. Use 'performanceMark' from '@angular/core' instead."
}
2021-05-29 11:25:53 +00:00
]
2017-09-22 17:51:03 +00:00
} ,
"jsRules" : {
2021-07-06 17:41:48 +00: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 14:57:07 +00:00
"eofline" : true ,
2018-08-16 22:55:45 +00:00
"file-header" : [
true ,
2020-05-19 19:07:26 +00:00
{
"match" : "Copyright Google LLC" ,
2021-12-10 02:37:01 +00:00
"allow-single-line-comments" : false ,
2024-09-20 15:23:15 +00:00
"default" : "@license\nCopyright Google LLC All Rights Reserved.\n\nUse of this source code is governed by an MIT-style license that can be\nfound in the LICENSE file at https://angular.dev/license"
2020-05-19 19:07:26 +00:00
}
2018-08-16 22:55:45 +00:00
] ,
2022-07-27 08:03:49 +00:00
"no-console" : [ true , "log" ] ,
2017-09-22 17:51:03 +00:00
"no-duplicate-imports" : true ,
"no-duplicate-variable" : true ,
2022-07-27 08:03:49 +00:00
"semicolon" : [ true ] ,
"variable-name" : [ true , "ban-keywords" ] ,
"no-inner-declarations" : [ true , "function" ] ,
2021-05-29 11:25:53 +00:00
"ban" : [
true ,
{ "name" : "fdescribe" , "message" : "Don't keep jasmine focus methods." } ,
{ "name" : "fit" , "message" : "Don't keep jasmine focus methods." }
2018-08-16 22:55:45 +00:00
]
2020-03-02 17:35:30 +00:00
} ,
"linterOptions" : {
"exclude" : [
"**/node_modules/**/*" ,
"./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 17:35:30 +00: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-12-09 05:44:17 +00:00
"./packages/zone.js/**/*" ,
2021-12-10 02:37:01 +00:00
"./devtools/bazel-out/**/*" ,
2022-09-15 00:18:25 +00:00
"./devtools/projects/ng-devtools/src/lib/vendor/**/*" ,
// Ignore vendored code
"./third_party/**/*"
2020-03-02 17:35:30 +00:00
]
2016-10-27 18:48:47 +00:00
}
2019-05-02 15:44:24 +00:00
}