Skip to content

Latest commit

 

History

History
286 lines (207 loc) · 16.9 KB

CHANGELOG.md

File metadata and controls

286 lines (207 loc) · 16.9 KB

vNEXT

Breaking changes

New rules

Updated rules

v15.0.1

New rules

  • import/extensions: see #987

v14.0.0

Breaking changes

New rules

Updated rules

  • @typescript-eslint/explicit-function-return-type
    • rule updated to not require an explicit return type annotation on anonymous functions
    • NOTE: technically, we accidentally removed this rule in v11 and this is restoring it with relaxed options
  • Disabled no-await-in-loop rule in recommended config.
  • Disabled many lodash rules:
    • lodash/chaining
    • lodash/identity-shorthand
    • lodash/prefer-compact
    • lodash/prefer-wrapper-method
    • lodash/prefer-get
    • lodash/prefer-is-nil
    • lodash/prefer-lodash-chain
    • lodash/prefer-startswith

v13.0.0

Breaking changes

  • eslint-plugin-goodeggs/prettier-config is no longer available! Please, use @goodeggs/toolkit/config/prettier instead.
  • Upgrade to eslint v8.
    • The most notable change is the addition of these four rules to the recommended set:
      • no-loss-of-precision
      • no-nonoctal-decimal-escape
      • no-unsafe-optional-chaining
      • no-useless-backreference
  • Upgrade from deprecated babel-eslint to @babel/eslint-parser.
  • Upgrade to eslint-plugin-jest@25.
    • A few rules were renamed. This would only be breaking if your codebase had an eslint override for one of these.
  • Upgrade to eslint-config-prettier@8.
    • This would only be breaking if your eslint config had some pretter config overrides for some reason.
  • Upgrade various other peer dependencies. This will only be breaking in @goodeggs/toolkit itself and seamless elsewhere.

New rules

Updated rules

v12.2.0

Updated rules

v12.0.4

New rules

  • no-constructor-return
    • We decided not to make this a major even though this technically breaking. We expect this to introduce no errors in almost every codebase.

v12.0.0

See #597 for a detailed changelog.

New rules

Updated rules

  • Restored naming convention rules for TypeScript files, unintentionally removed (regressed) in v11.
    • This closely resembles the configuration in v10.
    • There are a few small conveniences added that relax some previous rules.
    • There are also a few small additions that make this config a bit stricter than previously.
      • The most notable of these is requiring enum members to be in PascalCase.
  • Fixed various TypeScript rules by actually disabling the superseded base eslint rules. See https://github.com/typescript-eslint/typescript-eslint/blob/885780d4a2b07e418256b7323d76b18453c14a50/packages/eslint-plugin/README.md#extension-rules.
    • When upgrading to this version, you should clean up redundant overrides that disable the following rules:
      • camelcase
      • no-array-constructor
      • no-empty-function
      • no-extra-semi
      • no-implied-eval
      • no-shadow
      • no-throw-literal
      • no-unused-vars
      • no-use-before-define
      • no-useless-constructor

Known issues

Unfortunately, mongoose's Model (both in @types/mongoose and in the new built-in type declarations) is not typed as a class even though it is one. This means that TypeScript doesn't think it's a class, so @typescript/eslint doesn't think it's a class, so it doesn't allow PascalCase. It's unclear what next steps here are. Perhaps open a @types/mongoose issue or PR? In the meantime, this must be eslint-disabled or otherwise worked around (e.g. export the model without naming it).

v11.0.0

New rules

Updated rules

As part of the ESLint 7 upgrade, a few rules have been updated to cover more cases.

v10.0.0

  • Upgrade to Prettier 2.0. To upgrade, simultaneously upgrade eslint-plugin-goodeggs to v10 and prettier to v2, then run eslint --fix (or equivalent command) to reformat given the updated rules.

v9.0.1

v9.0.0

Removed rules

  • @typescript-eslint/ban-ts-ignore (error): Replaced by the newer, stricter ban-ts-comment rule. If your code overrides this rule, something like ag -Q '@typescript-eslint/ban-ts-ignore' -l --print0 | xargs -0 sed -i '' 's|@typescript-eslint/ban-ts-ignore|@typescript-eslint/ban-ts-comment|g' should fix most instances of it.

New rules

v8.1.0

  • TypeScript: Replace no-return-await with @typescript/eslint/return-await
  • TypeScript: Prohibit unnecessary non-null assertions (e.g. foo!!.bar)
  • TypeScript: Prohibit plus operators (+ and +=) on different types (e.g. prhibit adding a string to a number)

v8.0.0

This is a significant update with several breaking changes.

  • No longer bundle third-party eslint plugins in this package; instead, they are now peers, and it's the responsibility of the consumer to install them.
  • Revert all namespaced rules to their stock values (e.g. goodeggs/import-whatever -> import/whatever)
  • Rename base shared configuration from goodeggs to recommended (plugin:goodeggs/goodeggs -> plugin:goodeggs/recommended)
  • Break flowtype configuration into flowtype shared config (plugin:goodeggs/flowtype)
  • Break mocha configuration into mocha shared config (plugin:goodeggs/mocha)
  • Break TypeScript configuration into typescript shared config (plugin:goodeggs/typescript)
  • Break jest configuration into jest and jestStrict configurations (plugin:goodeggs/jest and plugin:goodeggs/jestStrict)
  • Remove all stylistic rules (covered by eslint-config-prettier)
  • Add React plugin and enable sane default rules that reflect current best practices and introduce some new ones that prevent common React performance errors.
  • Disable new-cap rules for unionized.JSONSchemaFactory (previously we only permitted JSONSchemaFactory)
  • Ops-specific rules:
    • Move ops-specific configuration into its own config (plugin:goodeggs/ops)
    • Disable new-cap rules dryrain(Api).DT_* invocations
  • We no longer configure the linter to find modules in locations other than node_modules (e.g. local_modules in ops repos, and src in Garbanzo). See the migration guide below for instructions on how to configure it.

In addition to these changes, many rules have been fixed, problematic rules disabled, and new rules enabled.

v7 -> v8 Migration Guide

1. Use @goodeggs/toolkit.

Uninstall eslint, babel-eslint, prettier, eslint-plugin-goodeggs, and any other ESLint plugins that are listed in the peer dependencies for this package.

Next, install @goodeggs/toolkit and replace any eslint scripts with getk run lint-es <glob> and getk run fix-es <glob>.

Finally, change the contents of .prettierrc.js to:

module.exports = require('@goodeggs/toolkit/config/prettier');

2. Remove the goodeggs/ prefix from all rules.

Edit your ESLint configuration and any inline overrides (run grep -R "eslint-disable.*goodeggs\/" . to find them).

Remove prefixes like so: goodeggs/import-no-commonjs becomes import/no-commonjs.

3. Update your project's eslint configuration.

Here's a baseline configuration that makes no assumptions about your environment or test framework, etc.:

{
  "extends": ["plugin:goodeggs/recommended"]
}

You will likely want to extend this with more rules (e.g. React rules); you can find a full list of configurations here.

4. Configure eslint-plugin-import's module resolver with your project's module settings.

We no longer automatically configure eslint-plugin-goodeggs with custom module directories. Module aliases are configured via Webpack, Babel, and other similar tools and specifying them in this repository has led to a tragedy-of-the-commons configuration that assumes implementation details and doesn't work particularly well for consumers.

If you use babel-plugin-module-resolver to create custom imports (e.g. in Garbanzo, imports like nettle/*), you must configure eslint-import-resolver-babel-module in your project.

Consumers that depend on the local_modules pattern provided by babel-plugin-local-modules should update their ESLint configuration to include the following configuration:

settings: {
  'import/resolver': {
    node: {
      moduleDirectory: [
        // Default
        'node_modules',
        // Adds anything in the root directory (including local_modules) to the module lookup path
        '.',
      ],
    },
  },
},

For more information, see this commit.

5. Fix all lint errors.

This release fixes a slew of broken lint rules and introduces new rules that target problematic code, and so you may need to fix new errors you haven't seen before. We tried to enable rules that were autofixable, but you'll need to manually fix those that are not.

  • Add DT_DecoderDataResponse (part of the DryRain API) to newCap exceptions
  • Disable prefer-reflect. This rule is deprecated and we already disable it all over the place.