Skip to content
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

feat(eslint-plugin)!: change recommended config #729

Merged
merged 22 commits into from Aug 13, 2019

Conversation

bradzacher
Copy link
Member

@bradzacher bradzacher commented Jul 20, 2019

BREAKING CHANGE: recommended config changes are considered breaking

See #651 for more info about what was included and why

Fixes #651
Fixes #433
Fixes #201
Fixes #493
Fixes #759
Fixes #822

BREAKING: recommended config changes are considered breaking
@bradzacher bradzacher added enhancement New feature or request breaking change This change will require a new major version to be released labels Jul 20, 2019
@bradzacher bradzacher added this to the 2.0.0 milestone Jul 20, 2019
@bradzacher bradzacher mentioned this pull request Jul 20, 2019
14 tasks
@bradzacher bradzacher changed the title feat(eslint-plugin): change recommended config feat(eslint-plugin)!: change recommended config Jul 21, 2019
# Conflicts:
#	packages/eslint-plugin/src/configs/base.json
#	packages/eslint-plugin/src/configs/recommended.json
# Conflicts:
#	packages/eslint-plugin/README.md
#	packages/eslint-plugin/src/configs/base.json
#	packages/eslint-plugin/src/configs/recommended.json
#	packages/eslint-plugin/src/rules/no-triple-slash-reference.ts
#	packages/eslint-plugin/src/rules/prefer-interface.ts
# Conflicts:
#	packages/eslint-plugin/README.md
# Conflicts:
#	.eslintrc.json
#	packages/eslint-plugin/src/rules/camelcase.ts
#	packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts
#	packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts
#	packages/eslint-plugin/tests/rules/indent/utils.ts
#	packages/eslint-plugin/tools/validate-docs/validate-table-structure.ts
#	packages/parser/src/analyze-scope.ts
#	packages/typescript-estree/tests/lib/semanticInfo.ts
#	yarn.lock
@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #729 into master will decrease coverage by 0.01%.
The diff coverage is 89.47%.

@@            Coverage Diff             @@
##           master     #729      +/-   ##
==========================================
- Coverage   94.21%   94.19%   -0.02%     
==========================================
  Files         112      112              
  Lines        4821     4825       +4     
  Branches     1336     1338       +2     
==========================================
+ Hits         4542     4545       +3     
- Misses        159      160       +1     
  Partials      120      120
Impacted Files Coverage Δ
.../eslint-plugin/src/rules/no-useless-constructor.ts 100% <ø> (ø) ⬆️
...ackages/eslint-plugin/src/rules/prefer-includes.ts 100% <ø> (ø) ⬆️
packages/eslint-plugin/src/rules/ban-types.ts 100% <ø> (ø) ⬆️
packages/parser/src/scope/scope-manager.ts 100% <ø> (ø) ⬆️
...ages/eslint-plugin/src/rules/no-require-imports.ts 100% <ø> (ø) ⬆️
...slint-plugin/src/rules/no-unnecessary-qualifier.ts 96.07% <ø> (ø) ⬆️
...ges/eslint-plugin/src/rules/no-misused-promises.ts 100% <ø> (ø) ⬆️
packages/eslint-plugin-tslint/src/custom-linter.ts 100% <ø> (ø) ⬆️
.../eslint-plugin/src/rules/triple-slash-reference.ts 90% <ø> (ø) ⬆️
...kages/eslint-plugin/src/rules/class-name-casing.ts 85.71% <ø> (ø) ⬆️
... and 60 more

@glen-84
Copy link
Contributor

glen-84 commented Aug 8, 2019

@bradzacher Should the documentation also be updated?

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contains some important updates to defaults of rules etc, and in general has a large diff, so I'm going to merge it and make the updates we discussed in a follow up.

Thanks again for doing this!

@JamesHenry JamesHenry merged commit 428567d into master Aug 13, 2019
@JamesHenry JamesHenry deleted the v2-update-recommended branch August 13, 2019 09:50
@bbugh
Copy link

bbugh commented Nov 28, 2019

Is there a full list of what was removed? We upgraded to the latest 2.x release from 1.x and notice a bunch of stuff (like no-console) that we rely on was removed, but I've looked through this issue and the PRs and I don't see a comprehensive list.

We'd like to put the recommended ones back in because we have a huge code base that relied on them. Thank you!

@bradzacher
Copy link
Member Author

@bbugh
You're probably looking for eslint's recommended list, which changed between eslint 5 and eslint 6:
https://github.com/eslint/eslint/blob/master/conf/eslint-recommended.js

We only change our configs, which are found here:
https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/src/configs

If you look at #651, you'll see an in-depth list of every single rule, and why or why not it was included in our v2 list.


As an aside, have a look at my personal config repo:
https://github.com/bradzacher/eslint-config-brad

In there I have tooling which strictly types config files to ensure I'm configuring rules correctly, and to ensure that I've configured every single available rule.

I strongly recommend that any appropriately large codebase should take ownership of their eslint config, and think about every single rule.

It will take a few hours to do e2e, sure, but the wins in terms of strict code style, error catching, etc are completely worth it for a large project.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.