Skip to content

Latest commit

 

History

History
641 lines (437 loc) · 54.6 KB

CHANGELOG.md

File metadata and controls

641 lines (437 loc) · 54.6 KB

Unreleased

Breaking changes ahead!

  • Eslint version 8 is now required (visit https://eslint.org/blog/2021/10/eslint-v8.0.0-released and other related blog posts for more info).

  • New rules enabled: fb-flow/use-indexed-access-type (more info), ft-flow/enforce-suppression-code and no-unused-private-class-members.

  • Many rules that were showing warnings in normal mode but errors in strict mode were converted to normal errors (so there is no difference between normal and strict mode). The best way how to migrate is to temporarily switch to the strict mode and address all the errors before upgrading to this major version.

  • Switched from eslint-plugin-flowtype to eslint-plugin-ft-flow which contains the same set of rules but should be more up to date and maintained. We are going to enable additional rules later. There is a possible minor breaking change (with very simple fix) when suppressing the rules manually, for example:

    - /* eslint-disable flowtype/require-valid-file-annotation */
    + /* eslint-disable ft-flow/require-valid-file-annotation */
  • Switched from eslint-plugin-node to eslint-plugin-n which contains the same set of rules but should be more up to date (and support Eslint 8). There is a possible minor breaking change (with very simple fix) when suppressing the rules manually, for example:

    - /* eslint-disable node/no-deprecated-api */
    + /* eslint-disable n/no-deprecated-api */

6.8.0

  • New rules enabled: @next/next/no-server-import-in-page, react/no-arrow-function-lifecycle, react/no-invalid-html-attribute and react/no-unused-class-component-methods (warnings or errors in strict mode).

6.7.0

  • Delete dropped rules from eslint-plugin-jest:
    • prefer-to-be-undefined
    • prefer-to-be-null
    • no-expect-resolves
    • no-truthy-falsy
    • no-try-expect
    • prefer-inline-snapshots
  • Rename renamed rules from eslint-plugin-jest:
    • valid-describe to valid-describe-callback
    • lowercase-name to prefer-lowercase-title
  • Additional rules from eslint-plugin-testing-library were enabled (warnings or errors in strict mode).

6.6.0

6.5.1

6.5.0

  • New rule fb-flow/use-flow-enums enabled. Additionally, rules no-fallthrough and no-case-declarations were upgraded to errors in strict mode to improve Flow Enums support. For more information please visit: https://flow.org/en/docs/enums/

  • New rules @next/next/inline-script-id, @next/next/no-script-in-document and @next/next/no-script-in-head enabled (as warnings). For more information visit: https://nextjs.org/docs/basic-features/eslint#eslint-plugin

  • Disable jsx-a11y/accessible-emoji rule, since it is deprecated and creates a degraded experience.

  • We clarified what to do when you are using @adeira/eslint-config/next preset inside monorepo (check our readme). Basically, you might encounter the following warning:

    Pages directory cannot be found at /X/Y/Z/pages or /X/Y/Z/src/pages. If using a custom path, please configure with the no-html-link-for-pages rule in your eslint config file
    

    In this case it's necessary to configure the Next.js eslint preset explicitly, for example:

    module.exports = {
      extends: ['@adeira/eslint-config', '@adeira/eslint-config/next'],
      settings: {
        next: { rootDir: __dirname },
      },
    };

    For more info visit: https://nextjs.org/docs/messages/no-html-link-for-pages

6.4.0

  • New rules @next/next/no-duplicate-head and @next/next/no-typos enabled in the Next.js preset (as warnings).
  • Rule no-redeclare now throws errors in strict mode. It still throws the same warnings in case you are using standard lint mode.
  • New rules fb-flow/flow-enums-default-if-possible and fb-flow/no-flow-enums-object-mapping enabled in the Flowtype preset (as warnings). Additionally, new rule fb-flow/use-exact-by-default-object-type replaces flowtype/require-exact-type rule (this is potentially breaking in case you are suppressing this rule somewhere in your codebase).

6.3.0

  • Added new optional config preset @adeira/eslint-config/next (for Next.js applications). This preset is not included in the default config and should be enabled explicitly for Next.js applications. For example:

    module.exports = {
      extends: [
        '@adeira/eslint-config', // this preset includes almost everything but not Next.js rules
        '@adeira/eslint-config/next', // adds extra Next.js rules for your application
      ],
    };

6.2.0

  • New rule max-nested-describe enabled (warnings or errors in strict mode).
  • New rule sx/use-logical-properties enabled (warnings or errors in strict mode).
  • You can now use config subsets for use cases where the main default config does not fit well.
    • @adeira/eslint-config/base - only the basic and most important JavaScript rules
    • @adeira/eslint-config/jest - Jest related rules
    • @adeira/eslint-config/react - React related rules (React, RN, Hooks, accessibility)
    • @adeira/eslint-config/flowtype - Flow related rules
    • @adeira/eslint-config/relay - Relay related rules

6.1.0

  • Rule import/no-extraneous-dependencies now ignores **/__flowtests__/**, **/__tests__/** and **/.storybook/** by default.
  • New rule import/no-relative-packages enabled (warnings or errors in strict mode).

6.0.0

Note for all Flow users: all projects in adeira/universe now use implicit exact Flow types ({} for strict objects and { ... } for open objects, syntax {||} is deprecated). We do not expect any issues with Flow types as long as you are using exact_by_default=true Flow option.

Because of this migration of adeira/universe to implicit exact objects (step 4 in this article: https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf) we are changing the following rules:

flowtype/require-exact-type               OFF -> ERROR with "never"
flowtype/require-inexact-type             ERROR -> OFF
flowtype/require-readonly-react-props     ERROR -> ERROR with "useImplicitExactTypes:true"

In case you want to prolong the support for explicit exact objects you can simply reverse these rules and you should be good to go.

Additional changes:

5.3.0

5.2.0

5.1.0

5.0.0

Support for Node.js 12 has been removed. This package might continue working on older Node.js versions, however, it's highly recommended upgrading to Node.js version 14 or newer. For more details, see: https://nodejs.org/en/about/releases/, or discuss here: #1588

4.4.0

4.3.0

4.2.0

  • Disabled rule relay/graphql-naming which is no longer accurate. We might enable it later again once this issue gets resolved: relayjs/eslint-plugin-relay#107

  • Rule no-unused-vars now ignores argument with special name _. This is handy when you really want to have some unused argument there (for example because your typechecker expects it).

  • Rule no-unsafe-optional-chaining enabled (warnings or errors in strict mode). Requires Eslint version >=7.15.0. You should have no issues if you use unnecessary-optional-chain Flow lint (highly recommended). Flowconfig example:

    [lints]
    unnecessary-optional-chain=error

4.1.0

4.0.0

This is a major release mainly focused on separating Eslint Runner. Do wou need some help with the breaking changes? Let us know!

  • Remove __ global, legacy of Nitrolib from Kiwi.com, see: https://kiwicom.github.io/nitrolib/services.html#intl
  • Set flowtype/require-readonly-react-props to throw errors
  • Eslint Runner is no longer part of this package. Please use @adeira/eslint-runner package instead for better experience.
  • Rule curly changed back from warnings to errors (see 3.1.1)
  • Rules no-promise-executor-return, no-unreachable-loop, no-loss-of-precision, flowtype/no-weak-types, jest/no-interpolation-in-snapshots, jsx-a11y/autocomplete-valid and relay/must-colocate-fragment-spreads promoted from warnings (errors in a strict mode) to always throw an error.

3.2.0

  • Rule adeira/no-invalid-flow-annotations checks for typos like @flow srict (should be @flow strict).
  • Rule flowtype/no-weak-types now returns warnings for Object and Function Flow types.
  • Rule no-loss-of-precision finally supports numeric separators so we enabled it (warnings or errors in a strict mode).
  • Prettier option quoteProps changed to "consistent".
  • Minimal required Eslint dependency version changed to ^7.8.1 (no-loss-of-precision requires it).

3.1.1

  • Fixed broken curly rule (warnings).

3.1.0

3.0.0

  • Upgrade to Prettier 2.0.5

2.2.1

  • Downgrade Prettier to 1.19.1 (should have been major upgrade)

2.2.0

  • Upgrade eslint to 7.2.0
  • Upgrade prettier to 2.0.5

2.1.0

  • Upgrade eslint to 7.1.0

2.0.0

  • Upgrade eslint to 7.0.0
  • set default-case-last to error
  • set no-useless-backreference to error
  • set jest/no-deprecated-functions to error
  • set jest/prefer-called-with to error
  • set react/jsx-no-script-url to error
  • set node/no-callback-literal to error
  • set eslint-comments/no-unlimited-disable to error

1.2.0

  • Eslint runner no longer crashes if git is not initialised or if there is no git remote. It will fall back to lint all files instead.

  • Eslint runner has been moved the the @adeira/eslint-runner and will be eventually removed from this package.

  • Added react/jsx-no-script-url as next_version_error

  • eslint-comments/no-unlimited-disable rule is turned on, ignoring all __generated__/*.graphql.js files by default, so files autogenerated by Relay compiler are not reported. Follow Eslint Docs on how to disable additional group of files if needed.

    An example on how to adjust this rule in .eslintrc.js:

    module.exports = {
      overrides: [
        {
          // turns of "eslint-comments/no-unlimited-disable" for all fixtures
          files: ['**/babel-preset-adeira/**/__fixtures__/**/*.js'],
          rules: {
            'eslint-comments/no-unlimited-disable': 'off',
          },
        },
      ],
    };

1.1.0

  • New Eslint Runner CLI option --no-warnings

1.0.0

  • Add new rule adeira/no-duplicate-import-type-import;

0.4.0

  • Lint all files when .eslintignore changes

0.3.0

  • New rule adeira/valid-test-folder.

0.2.0

  • Remove eslint-plugin-react-native
  • New rule jest/valid-title added (warnings or errors in strict mode).

0.8.4.0

  • Changes in package.json will trigger eslint runner to run with --all flag
  • Rule no-unused-vars now allows unused variable when it's used to omit properties from object using rest spread.
  • New rule jest/prefer-hooks-on-top added (warnings or errors in strict mode).

0.8.3.0

  • New rule kiwicom-incubator/no-internal-flow-type enabled (warnings or errors in strict mode). This rule forces you to use types like React.Node instead of React$Node.

0.8.2.0

0.8.1.0

  • Added @kiwicom/eslint-config/nitro as a replacement for deprecated @kiwicom/eslint-config-nitro.
  • Rules symbol-description, yoda, react/no-unknown-property, react/jsx-no-comment-textnodes now throw errors in strict mode.
  • Rule react/style-prop-object now shows warnings (errors in strict mode).
  • New rule relay/hook-required-argument added (warnings or errors in strict mode).
  • Rule flowtype/no-unused-expressions now supports tagged templates. This is useful to combine with @inline GraphQL fragments definition for example.

0.8.0.0

0.7.1.1

  • Exceptions on mishmashed Eslint plugin versions has been reverted back to warnings only.

0.7.1.0

  • Tests runner now throws exceptions when you have mishmashed Eslint plugin versions. This is potentially breaking change but you should not have such mishmash in your codebase anyway (it creates problems when running Eslint).
  • Added brand new rule node/no-callback-literal which shows warnings in both normal and strict mode.

0.7.0.0

0.6.5.0

0.6.4.0

0.6.3.0

  • Allow use of devDependencies in **/*.stories.js (Storybook story files), **/webpack.config.js and **/metro.config.js.

0.6.2.0

  • Eslint runner now automatically checks your dependency tree and warns you when you are using multiple plugins with possibly incompatible versions (common source of Definition for rule 'xyz' was not found errors).

0.6.1.0

0.6.0.0

  • Breaking: default line width is now 100 to be compatible with other JavaScript projects. Migration is super simple if you use our Eslint Runner: just run it with option --all and it will fix the lines automatically. You will probably have to fix some additional failing tests/lint rules but it should not take you more than a few minutes. As always: first upgrade to previous versions and fix the warnings.

0.5.0.0

This is a major release with breaking changes. The main changes are major Eslint upgrade and bump of some warnings to errors (strict mode reset). Please upgrade all previous versions first and fix all the warnings before upgrading to version 5.0.

  • Breaking: Eslint upgraded to version 6.0+ which is now required by peer dependencies. See: https://eslint.org/docs/6.0.0/user-guide/migrating-to-6.0.0
  • The following rules are now errors instead of warnings (no change in strict mode):
    • no-async-promise-executor, no-cond-assign, no-control-regex, no-duplicate-case, no-empty-character-class, no-ex-assign, no-extra-boolean-cast, no-irregular-whitespace, no-misleading-character-class, no-prototype-builtins, no-regex-spaces, no-template-curly-in-string, no-unsafe-finally, array-callback-return, dot-notation, eqeqeq, guard-for-in, no-empty-pattern, no-extra-label, no-iterator, no-lone-blocks, no-loop-func, no-octal, no-octal-escape, no-useless-catch, no-useless-concat, no-useless-escape, no-with, vars-on-top, no-shadow-restricted-names, no-undef-init, no-bitwise, no-nested-ternary, no-useless-computed-key, no-useless-constructor, no-var, prefer-template, require-yield
    • flowtype/require-inexact-type
    • react/button-has-type, react/forbid-dom-props, react/jsx-pascal-case, react/jsx-uses-vars, react/no-danger-with-children, react/no-deprecated, react/no-direct-mutation-state, react/no-find-dom-node, react/no-is-mounted, react/no-multi-comp, react/no-redundant-should-component-update, react/no-render-return-value, react/no-this-in-sfc, react/no-unescaped-entities, react/prefer-es6-class, react/require-render-return, react/self-closing-comp, react/sort-comp, react/void-dom-elements-no-children
    • jsx-a11y/anchor-is-valid, jsx-a11y/aria-proptypes, jsx-a11y/aria-role, jsx-a11y/html-has-lang, jsx-a11y/iframe-has-title, jsx-a11y/interactive-supports-focus, jsx-a11y/lang, jsx-a11y/no-access-key, jsx-a11y/no-autofocus, jsx-a11y/no-redundant-roles, jsx-a11y/role-has-required-aria-props, jsx-a11y/role-supports-aria-props, jsx-a11y/scope, jsx-a11y/tabindex-no-positive
    • import/export, import/extensions, import/first, import/no-amd, import/no-duplicates, import/no-named-default, import/no-webpack-loader-syntax, import/no-self-import
    • node/file-extension-in-import
    • relay-imports/no-values, relay-imports/type-must-exist

There are no other behavioral changes so if you fixed all the warnings from previous versions then you should be good to go.

0.4.11.0

  • Unmaintained plugin eslint-plugin-dependencies was removed. We already cover most of the cases with import plugin. This change is done in backward compatible manner: dependencies/case-sensitive doesn't have replacement and it's been removed, dependencies/no-cycles is replaced with import/no-cycle and dependencies/require-json-ext was replaced with import/extensions. Please, report any issues.

0.4.10.0

0.4.9.0

0.4.8.0

0.4.7.0

This release focuses on enabling more rules to match closer with Nitro config. It also shows new warnings for implicit inexact Flow types as a preparation for exact objects by default. As always, please do not hesitate to upgrade, fix all your warnings and report any issues and misbehavior.

0.4.6.0

There are many non-breaking changes in this release but mostly covering edge cases. Please, report any issues so we can reconsider some of them. Also, do not hesitate to upgrade your codebase. We are currently trying to unify our config and Nitro config.

0.4.5.0

  • New warnings for our custom rule relay-imports/no-values and relay-imports/type-must-exist (errors in strict mode). These rules should help you to find mistakes while importing Flow types from generated Relay files.

0.4.4.0

0.4.3.0

0.4.2.0

  • Plugin eslint-plugin-node upgraded to the latest version 9.0.0 which drops support for old Node.js and Eslint. There are also some updated rules but it should not be a big problem in our company. Therefore, this is not released as a major change from our Eslint config point of view. New rule node/file-extension-in-import shows warnings (errors in strict mode).

0.4.1.0

0.4.0.1

  • Rule react/sort-comp now returns warnings (errors in the strict mode) to simplify the migration. Turned out this rule was not configured properly and it's not battle-tested yet. You can use sort-comp React codemod to easily migrate your codebase. Please report any issues with this rule even if you just simply don't like the enforced result.

0.4.0.0

0.3.6.0

0.3.5.0

0.3.4.0

0.3.3.0

0.3.2.0

  • New rule jest/no-empty-title shows warnings
  • Internal dependencies upgraded (no issues expected)

0.3.1.0

0.3.0.0

0.2.16.0

  • New @kiwicom/eslint-config/strict mode added - check docs for more info
  • Rule require-await now shows warnings

0.2.15.0

  • Some basic jsx-a11y added: should not cause many warnings

0.2.14.0

  • Disable no-duplicate-imports rule
  • Set import/no-duplicates to WARN. Which is more intelligent than no-duplicate-imports and can differentiate between import and import type

0.2.13.0

  • Eslint now warns for unused function parameters

0.2.12.0

0.2.11.0

  • Eslint now warns when you use @noflow or @flow weak file annotations

0.2.10.0

0.2.9.0

  • Disable rule react/no-did-mount-set-state by default

0.2.8.0

  • Add FormData to the globals
  • Rule import/no-unresolved now ignores Relay artifacts set by artifactDirectory
  • Upgrade eslint-plugin-react-hooks to the latest stable version (^1.0.1)

0.2.7.0

  • Enable warnings for jest/prefer-todo rule

0.2.6.0

  • Enable warnings for react/sort-comp rule

0.2.5.0

  • Detect React version automatically

0.2.4.0

  • Disable rules from eslint-plugin-babel that are in conflict with Prettier
  • Eslint dependencies upgraded to the latest versions

0.2.3.0

  • Disable rule eslint-comments/no-unlimited-disable to make it more Relay friendly

0.2.2.0

  • Rule new-cap now throws warnings for lower-cased class usages
  • Add new react-hooks/rules-of-hooks
  • Added support for __DEV__ expression

0.2.1.0

  • Show warnings for no-unused-vars, jest/prefer-to-be-null, jest/prefer-to-be-undefined, jest/prefer-to-contain, jest/prefer-to-have-length and eslint-comments/no-unlimited-disable

0.2.0.0

  • Prettier is now in charge of styling issues

0.1.5.0

  • Set react/no-did-mount-set-state and react/no-did-update-set-state to WARN
  • Add support for RN and RNW file extensions (*.ios.js, *.android.js, ...)

0.1.4.0

  • Added new eslint-plugin-eslint-comments to check Eslint comments
  • Eslint now warns when using useless combination or return await (no-return-await)

0.1.3.0

  • Added new no-useless-catch warning
  • Replace Jasmine eslint rules with better Jest rules

0.1.2.0

  • Fixed camelcase rule to work correctly with optional chaining (a?.b)

0.1.1.0

  • Added new plugin for Node.js
  • Eslint is now required as a peer dependency