Skip to content
This repository has been archived by the owner on Jan 20, 2025. It is now read-only.

Commit

Permalink
Eslint config: add new rule 'flowtype/require-inexact-type'
Browse files Browse the repository at this point in the history
I had to wait a little bit because of this issue: gajus/eslint-plugin-flowtype#408 (comment) (fixed here: gajus/eslint-plugin-flowtype#409).

Implicit inexact objects are now officially disabled in Universe.

kiwicom-source-id: 9eda5b44be7928d6b4ff505b5e447b8c75dbda1b
  • Loading branch information
Martin Zlámal authored and kiwicom-github-bot committed Jun 10, 2019
1 parent 88a7b6a commit cbb79a4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Unreleased

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](https://medium.com/flow-type/on-the-roadmap-exact-objects-by-default-16b72933c5cf). As always, please do not hesitate to upgrade, fix all your warnings and report any issues and misbehavior.

- New rule for checking inexact Flow types (warnings or errors in strict mode): [`flowtype/require-inexact-type`](https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-require-inexact-type)
- Following rules now show warnings (errors in strict mode): [`no-template-curly-in-string`](https://eslint.org/docs/rules/no-template-curly-in-string), [`array-callback-return`](https://eslint.org/docs/rules/array-callback-return), [`no-loop-func`](https://eslint.org/docs/rules/no-loop-func), [`vars-on-top`](https://eslint.org/docs/rules/vars-on-top), [`no-nested-ternary`](https://eslint.org/docs/rules/no-nested-ternary), [`prefer-template`](https://eslint.org/docs/rules/prefer-template)
- Following React-related rules now show warnings (errors in strict mode): [`react/button-has-type`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/button-has-type.md), [`react/no-danger-with-children`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger-with-children.md), [`react/no-find-dom-node`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md), [`react/no-is-mounted`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md), [`react/no-multi-comp`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md), [`react/no-render-return-value`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md), [`react/jsx-uses-vars`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md), [`react/no-this-in-sfc`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-this-in-sfc.md), [`react/void-dom-elements-no-children`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md), [`react/prefer-es6-class`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md), [`react/no-unused-state`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unused-state.md), [`react/no-unescaped-entities`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unescaped-entities.md)

Expand Down
1 change: 1 addition & 0 deletions __tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Object {
"flowtype/object-type-delimiter": "off",
"flowtype/require-compound-type-alias": 0,
"flowtype/require-exact-type": 0,
"flowtype/require-inexact-type": 1,
"flowtype/require-parameter-type": 0,
"flowtype/require-readonly-react-props": 0,
"flowtype/require-return-type": 0,
Expand Down
1 change: 1 addition & 0 deletions __tests__/__snapshots__/nitroDifferences.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ N - flowtype/no-primitive-constructor-types ("warn")
N - flowtype/no-unused-expressions ("error")
N - flowtype/require-compound-type-alias ("off")
N - flowtype/require-exact-type ("off")
N - flowtype/require-inexact-type ("error")
N - flowtype/require-types-at-top ("off")
N - flowtype/require-variable-type ("off")
N - flowtype/sort-keys ("off")
Expand Down
1 change: 1 addition & 0 deletions ourRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ module.exports = {
'flowtype/no-weak-types': OFF,
'flowtype/require-compound-type-alias': OFF,
'flowtype/require-exact-type': OFF,
'flowtype/require-inexact-type': NEXT_VERSION_ERROR,
'flowtype/require-parameter-type': OFF,
'flowtype/require-readonly-react-props': OFF, // TODO: https://github.com/gajus/eslint-plugin-flowtype/pull/400#issuecomment-492828739
'flowtype/require-return-type': OFF,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-dependencies": "^2.4.0",
"eslint-plugin-eslint-comments": "^3.1.1",
"eslint-plugin-flowtype": "^3.9.1",
"eslint-plugin-flowtype": "^3.10.1",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-jest": "^22.6.4",
"eslint-plugin-jsx-a11y": "^6.2.1",
Expand Down

0 comments on commit cbb79a4

Please # to comment.