diff --git a/.eslintrc b/.eslintrc index 9f874b83c24..b791b4c3663 100644 --- a/.eslintrc +++ b/.eslintrc @@ -28,7 +28,7 @@ "allowBlockStart": false } ], - "babel/no-unused-expressions": "off", + "@babel/no-unused-expressions": "off", "import/named": "off", "import/no-default-export": ["error"], "react/button-has-type": "off", @@ -74,7 +74,10 @@ "files": ["**/*.test.{ts,tsx}"], "rules": { "jest/no-truthy-falsy": "off", - "@shopify/no-ancestor-directory-import": "off" + "react/jsx-no-constructed-context-values": "off", + "@shopify/jsx-no-hardcoded-content": "off", + "@shopify/no-ancestor-directory-import": "off", + "@shopify/react-require-autocomplete": "off" } }, { @@ -87,7 +90,7 @@ } }, { - "files": ["playground/Playground.tsx"], + "files": ["playground/*.tsx"], "rules": { "react/prefer-stateless-function": "off", "@shopify/jsx-no-hardcoded-content": "off", diff --git a/UNRELEASED.md b/UNRELEASED.md index f1322978849..341a736a4d7 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -30,6 +30,7 @@ Use [the changelog guidelines](/documentation/Versioning%20and%20changelog.md) t - Bumped `node-sass` to `v6.0.1` ([#4783](https://github.com/Shopify/polaris-react/pull/4783)) - Bumped `sass-loader` to `v10.1.1` ([#4783](https://github.com/Shopify/polaris-react/pull/4783)) - Bumped `stylelint` to `v14.1.0` and `@shopify/stylelint-plugin` to `v11.0.0` ([#4798](https://github.com/Shopify/polaris-react/pull/4798)) +- Bumped `eslint` to `v8.3.0` and `@shopify/eslint-plugin` to `v41.0.1` ([#4797](https://github.com/Shopify/polaris-react/pull/4797)) ### Code quality diff --git a/package.json b/package.json index 18c8df73ca0..18661c7ae52 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@rollup/pluginutils": "^3.1.0", "@shopify/babel-preset": "^24.1.2", "@shopify/browserslist-config": "^3.0.0", - "@shopify/eslint-plugin": "^39.0.1", + "@shopify/eslint-plugin": "^41.0.1", "@shopify/jest-dom-mocks": "^3.0.5", "@shopify/loom": "^1.0.0", "@shopify/loom-cli": "^1.0.0", @@ -121,7 +121,7 @@ "core-js": "^3.6.5", "create-file-webpack": "^1.0.2", "downlevel-dts": "^0.6.0", - "eslint": "^7.32.0", + "eslint": "^8.3.0", "fs-extra": "^7.0.1", "glob": "^7.1.4", "gray-matter": "^4.0.2", diff --git a/playground/KitchenSink.tsx b/playground/KitchenSink.tsx index 8b3a9afef8d..3da75ae7660 100644 --- a/playground/KitchenSink.tsx +++ b/playground/KitchenSink.tsx @@ -1,6 +1,8 @@ import React from 'react'; -type ReadmeModule = Record; +interface ReadmeModule { + [key: string]: any; +} const readmeReq = require.context( '../src/components', diff --git a/src/components/AppProvider/AppProvider.tsx b/src/components/AppProvider/AppProvider.tsx index f9b9240d8f9..d85a6d03b37 100644 --- a/src/components/AppProvider/AppProvider.tsx +++ b/src/components/AppProvider/AppProvider.tsx @@ -87,12 +87,12 @@ export class AppProvider extends Component { } render() { - const {theme = {}, children} = this.props; + const {theme = {}, features = {}, children} = this.props; const {intl, link} = this.state; return ( - + diff --git a/src/components/Autocomplete/Autocomplete.tsx b/src/components/Autocomplete/Autocomplete.tsx index 7b4bacf7a4b..d80b5031f6e 100644 --- a/src/components/Autocomplete/Autocomplete.tsx +++ b/src/components/Autocomplete/Autocomplete.tsx @@ -73,8 +73,8 @@ export const Autocomplete: React.FunctionComponent & { (options: OptionDescriptor[]) => { return options.map((option) => ( diff --git a/src/components/Banner/tests/Banner.test.tsx b/src/components/Banner/tests/Banner.test.tsx index 66abeb48fe7..101a3c48ea1 100644 --- a/src/components/Banner/tests/Banner.test.tsx +++ b/src/components/Banner/tests/Banner.test.tsx @@ -333,7 +333,7 @@ describe('', () => { DiamondAlertMajor, ], ])( - 'Sets Icon props when: %s', + 'sets Icon props when: %s', (_: any, status: any, color: any, iconSource: any) => { const banner = mountWithApp(); diff --git a/src/components/BulkActions/BulkActions.tsx b/src/components/BulkActions/BulkActions.tsx index 6d7d1ce2cc4..74fcee8351d 100644 --- a/src/components/BulkActions/BulkActions.tsx +++ b/src/components/BulkActions/BulkActions.tsx @@ -336,9 +336,9 @@ class BulkActionsInner extends PureComponent { } return ( ); diff --git a/src/components/Button/tests/Button.test.tsx b/src/components/Button/tests/Button.test.tsx index 8f3fa20f66e..a57041a4494 100644 --- a/src/components/Button/tests/Button.test.tsx +++ b/src/components/Button/tests/Button.test.tsx @@ -109,6 +109,7 @@ describe('