Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Update in preparation for v6 #15

Merged
merged 3 commits into from
Jan 15, 2021
Merged

Update in preparation for v6 #15

merged 3 commits into from
Jan 15, 2021

Conversation

edsrzf
Copy link
Collaborator

@edsrzf edsrzf commented Jan 15, 2021

No major changes in this release, but some rules did change, so it will be a new major version. The primary goal here is to get in the newest major version of @typescript-eslint packages.

Changes:

  • Update all dependencies to the latest version.
  • Tweak rules according to annoyances we've encountered. (See inline comments.)

@@ -43,8 +43,8 @@ module.exports = {
// Don't allow unused labels.
'no-unused-labels': 'off',

// Disallow the 'var' keyword.
'no-var': 'error',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no-var is now included in the Standard config.

@@ -55,59 +55,6 @@ module.exports = {
// Require the radix argument to parseInt to avoid unintentionally allowing hex or octal.
radix: 'error',

// Naming conventions. The TypeScript rule is much more complete and configurable than ESLint's.
camelcase: 'off',
'@typescript-eslint/naming-convention': [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@typescript-eslint/naming-convention now requires type information, which means it can only be run on TypeScript files. I've moved it below. camelcase will still apply to JS files.

@@ -156,6 +103,7 @@ module.exports = {
'react/jsx-handler-names': 'off',

// We use TypeScript so don't usually need PropTypes.
'react/no-unused-prop-types': 'off',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was flagging false positives in some TypeScript code.

@@ -311,13 +318,6 @@ module.exports = {
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',

// Don't allow extra semi-colons.
'no-extra-semi': 'off',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is covered by Prettier, and conflicts with some of Prettier's opinions.

@@ -276,12 +283,6 @@ module.exports = {
{ assertionStyle: 'as' },
],

// Prefer interfaces over type literals (type T = { ... }).
'@typescript-eslint/consistent-type-definitions': [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It turns out that interfaces and type literals are not completely equivalent, and there are use cases for type literals over interfaces. This rule does not account for those use cases.

See microsoft/TypeScript#13573.

Copy link

@stephen-boswell stephen-boswell left a comment

Choose a reason for hiding this comment

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

lgtm 👍

Copy link

@nathan-cairns nathan-cairns left a comment

Choose a reason for hiding this comment

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

Nice! LGTM!!

@edsrzf edsrzf merged commit b2a0444 into master Jan 15, 2021
@edsrzf edsrzf deleted the update-v6 branch January 15, 2021 01:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants