-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use consistent coding styling between projects #2918
Comments
We want to migrate to ESlint either way, so bringing more consistency at the same time would be a nice idea. Would you like to create PR for this issue? One thing to note - if some change will require lots of code modifications, please, ask in the PR beforehand :) |
Sure! I will open a PR first in https://github.com/nestjs/typescript-starter to start simple. |
I started migrating our NestJs repo to ESLint, it seems pretty painless atm (well, except the prettier + eslint 6 + vscode quircks) |
My current setup in Nest project: .eslintrc {
"extends": ["prettier"],
"plugins": ["prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"prettier/prettier": "error"
}
} .prettierrc {
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
} package.json {
"scripts": {
"lint": "eslint src/**/*.ts"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^2.3.2",
"@typescript-eslint/parser": "^2.3.2",
"eslint": "^6.5.1",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-prettier": "^3.1.1",
"prettier": "^1.18.2"
}
} For VS Code: .vscode/settings.json {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
} |
We're actively migrating to ESLint now. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I have noticed that the CLI starter, the documentation, the main project, and officials modules have all different set of TSLint rules applied to them. I propose that we normalize all those rules by enforcing one set of well documented and thought rules, such as the http://airbnb.io/javascript, across all the different official projects.
That would make the reading easier, add constancy to the different projects, and enforce many good practices that have long been discussed.
Prettier could still be used and would work with the linting rules by using the following ESLint extensions:
If that makes, I would open the different PRs on the projects to apply the configuration change.
The text was updated successfully, but these errors were encountered: