prettier / tslint-config-prettier

Use TSLint with Prettier without any conflict

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`ng lint` showing errors on fresh install

Anticom opened this issue · comments

After setting "extends": ["tslint:latest", "tslint-config-prettier"] ng lint is giving me the following errors on a fresh project:

ERROR: /path/to/project/e2e/app.po.ts[1, 38]: Module 'protractor' is not listed as dependency in package.json
ERROR: /path/to/project/src/app/app-routing.module.ts[2, 10]: Named imports must be alphabetized.
ERROR: /path/to/project/src/app/app.component.spec.ts[1, 10]: Named imports must be alphabetized.
ERROR: /path/to/project/src/app/app.component.spec.ts[1, 32]: Submodule import paths from this package are disallowed; import from the root instead
ERROR: /path/to/project/src/app/app.component.spec.ts[2, 37]: Submodule import paths from this package are disallowed; import from the root instead
ERROR: /path/to/project/src/app/app.module.ts[2, 1]: Import sources within a group must be alphabetized.
ERROR: /path/to/project/src/polyfills.ts[21, 1]: jsdoc is not formatted correctly on this line
ERROR: /path/to/project/src/polyfills.ts[44, 1]: jsdoc is not formatted correctly on this line
ERROR: /path/to/project/src/polyfills.ts[46, 8]: Submodule import paths from this package are disallowed; import from the root instead
ERROR: /path/to/project/src/polyfills.ts[52, 1]: jsdoc is not formatted correctly on this line
ERROR: /path/to/project/src/polyfills.ts[52, 1]: asterisks in jsdoc must be aligned
ERROR: /path/to/project/src/polyfills.ts[73, 8]: Submodule import paths from this package are disallowed; import from the root instead
ERROR: /path/to/project/src/test.ts[3, 8]: Submodule import paths from this package are disallowed; import from the root instead
ERROR: /path/to/project/src/test.ts[4, 1]: Import sources within a group must be alphabetized.
ERROR: /path/to/project/src/test.ts[4, 28]: Submodule import paths from this package are disallowed; import from the root instead
ERROR: /path/to/project/src/test.ts[8, 8]: Submodule import paths from this package are disallowed; import from the root instead

Am I not supposed to use ng lint anymore or are the linting rules now fundamentally different or what's the story?

commented

You can change tslint:latest to whatever rule config you want, e.g. tslint:recommended, etc.

It's just an example for demo, the only notable thing is to make sure tslint-config-prettier is at the end of extends.