Delete the following rules from your tslint.json to avoid conflict w/ Prettier
If any of them are missing, that is fine. Just move on.
- comment-format
- curly
- eofline
- import-spacing
- indent
- max-line-length
- no-trailing-whitespace
const rules = config.module.rules; | |
// File the rules from the build that builds all the TS files. The MainRule | |
const mainRule = rules.find((r) => { | |
// If not in prod mode, this IF will find the mainRule | |
if (r.loader) { | |
return ( | |
r && r.loader && r.loader.endsWith(angularLoaderFilename) | |
); |
const webpack = require('webpack'); | |
module.exports = { | |
module: { | |
rules: [ | |
{ | |
test: /\.ts$/, | |
exclude: /node_modules|src/, | |
use: [ | |
{ |
// If tslint@5.0.0+ | |
{ | |
"extends": [ | |
"tslint:latest", | |
"tslint-plugin-prettier" | |
], | |
"rules": { | |
"prettier": true | |
} | |
} |
{ | |
"extends": [ | |
"tslint:latest", | |
"tslint-config-prettier", | |
], | |
} |
- comment-format
- curly
- eofline
- import-spacing
- indent
- max-line-length
- no-trailing-whitespace
package.json |
// The values provided below are the defaults. | |
// If you don't specify one of these properties, | |
// the default value will be applied. | |
module.exports = { | |
printWidth: 80, | |
tabWidth: 2, | |
useTabs: true, | |
semi: true, | |
singleQuote: false, | |
trailingComma: 'none', // other options `es5` or `all` |
export class FooClass{ | |
constructor( | |
private fb: FirebaseApp, | |
private fs: AngularFirestore, | |
){ | |
const a = fb.firestore(); | |
const b = this.fs; | |
// Are `a` and `b` pointing at the same thing? | |
} |
[ | |
{ | |
path: 'team/:id', | |
loadChildren: './team/team.module#TeamModule' | |
} | |
] |
const webpackconfig = { | |
module:{ | |
rules: [ | |
{ | |
test: /\.ts$/, | |
use: [ | |
{ | |
loader: '@ngtools/webpack' | |
} | |
] |