If you have a long import with many characters exceeding es lint max length, you will have to add the following line to ignore that:
// eslint-disable-next-line max-len
The other solution is to add the following setting in .eslintrc.json file present at the root of the solution:
{
"files": ["*.ts"],
"rules": {
"max-len": [
"error",
{
"code": 140,
"ignorePattern": "^import"
}
]
}
The complete file will look this:
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json"],
"createDefaultProgram": true
},
..........
..........
{
"files": ["*.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {}
},
{
"files": ["*.ts"],
"rules": {
"max-len": [
"error",
{
"code": 140,
"ignorePattern": "^import"
}
]
}
}
]
}