diff --git a/.eslintignore b/.eslintignore index 5ae1504b1a3235..8941546b34343e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -16,6 +16,9 @@ /packages/material-ui-icons/legacy /packages/material-ui-icons/src /packages/material-ui-icons/templateSvgIcon.js +# TODO +/packages/typescript-to-proptypes/ +/framer/ # Ignore fixtures /packages/typescript-to-proptypes/test/**/*.js /tmp diff --git a/.eslintrc.js b/.eslintrc.js index 68a9f0e6a2981b..8e9fb5b5a6e3a3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,4 +1,3 @@ -const confusingBrowserGlobals = require('confusing-browser-globals'); const path = require('path'); module.exports = { @@ -11,13 +10,19 @@ module.exports = { browser: true, node: true, }, - extends: ['plugin:import/recommended', 'airbnb', 'prettier', 'prettier/react'], - parser: 'babel-eslint', + extends: [ + 'plugin:import/recommended', + 'plugin:import/typescript', + 'airbnb-typescript', + 'prettier', + 'prettier/react', + 'prettier/@typescript-eslint', + ], + parser: '@typescript-eslint/parser', parserOptions: { ecmaVersion: 7, - sourceType: 'module', }, - plugins: ['babel', 'material-ui', 'react-hooks'], + plugins: ['material-ui', 'react-hooks', '@typescript-eslint'], settings: { 'import/resolver': { webpack: { @@ -31,16 +36,11 @@ module.exports = { */ rules: { 'consistent-this': ['error', 'self'], - 'linebreak-style': 'off', // Doesn't play nicely with Windows // just as bad as "max components per file" 'max-classes-per-file': 'off', - 'no-alert': 'error', - // Strict, airbnb is using warn; allow warn and error for dev environments - 'no-console': ['error', { allow: ['warn', 'error'] }], - 'no-constant-condition': 'error', - // Airbnb use error - 'no-param-reassign': 'off', - 'no-prototype-builtins': 'off', + 'no-alert': 'error', // Too much interruptive + 'no-console': ['error', { allow: ['warn', 'error'] }], // Allow warn and error for production events + 'no-param-reassign': 'off', // It's fine. 'no-restricted-imports': [ 'error', { @@ -51,64 +51,38 @@ module.exports = { ], }, ], - 'nonblock-statement-body-position': 'error', - // Airbnb restricts isNaN and isFinite which are necessary for IE 11 - // we have to be disciplined about the usage and ensure the Number type for its - // arguments - 'no-restricted-globals': ['error'].concat(confusingBrowserGlobals), + 'no-constant-condition': 'error', + 'no-prototype-builtins': 'off', // Use the proptype inheritance chain 'no-underscore-dangle': 'error', + 'nonblock-statement-body-position': 'error', 'prefer-arrow-callback': ['error', { allowNamedFunctions: true }], 'prefer-destructuring': 'off', // Destructuring harm grep potential. - - 'jsx-a11y/label-has-associated-control': 'off', - 'jsx-a11y/label-has-for': 'off', // deprecated - 'jsx-a11y/no-autofocus': 'off', // We are a library, people do what they want. - + '@typescript-eslint/dot-notation': 'off', // TODO performance consideration + '@typescript-eslint/no-implied-eval': 'off', // TODO performance consideration + '@typescript-eslint/no-throw-literal': 'off', // TODO performance consideration + 'import/named': 'off', // Not sure why it doesn't work + 'import/no-extraneous-dependencies': 'off', // Missing yarn workspace support + 'jsx-a11y/label-has-associated-control': 'off', // doesn't work? + 'jsx-a11y/no-autofocus': 'off', // We are a library, we need to support it too 'material-ui/docgen-ignore-before-comment': 'error', - - // This rule is great for raising people awareness of what a key is and how it works. - 'react/no-array-index-key': 'off', - 'react/destructuring-assignment': 'off', - // It's buggy - 'react/forbid-prop-types': 'off', - 'react/jsx-curly-brace-presence': 'off', - // prefer over <>. The former allows `key` while the latter doesn't - 'react/jsx-fragments': ['error', 'element'], - 'react/jsx-filename-extension': ['error', { extensions: ['.js'] }], // airbnb is using .jsx - 'react/jsx-handler-names': [ - 'error', - { - // airbnb is disabling this rule - eventHandlerPrefix: 'handle', - eventHandlerPropPrefix: 'on', - }, - ], - // not a good rule for components close to the DOM - 'react/jsx-props-no-spreading': 'off', + 'react-hooks/exhaustive-deps': ['error', { additionalHooks: 'useEnhancedEffect' }], + 'react-hooks/rules-of-hooks': 'error', + 'react/destructuring-assignment': 'off', // It's fine. + 'react/forbid-prop-types': 'off', // Too strict, no time for that + 'react/jsx-curly-brace-presence': 'off', // broken + 'react/jsx-filename-extension': ['error', { extensions: ['.js', '.tsx'] }], // airbnb is using .jsx + 'react/jsx-fragments': ['error', 'element'], // Prefer over <>. + 'react/jsx-props-no-spreading': 'off', // We are a UI library. + 'react/no-array-index-key': 'off', // This rule is great for raising people awareness of what a key is and how it works. 'react/no-danger': 'error', - // Strict, airbnb is using off 'react/no-direct-mutation-state': 'error', - 'react/no-find-dom-node': 'off', - 'react/no-multi-comp': 'off', - 'react/require-default-props': 'off', + 'react/no-find-dom-node': 'off', // Required for backward compatibility. TODO v5, drop + 'react/require-default-props': 'off', // Not always relevant 'react/sort-prop-types': 'error', // This depends entirely on what you're doing. There's no universal pattern 'react/state-in-constructor': 'off', // stylistic opinion. For conditional assignment we want it outside, otherwise as static 'react/static-property-placement': 'off', - - 'import/no-extraneous-dependencies': 'off', // It would be better to enable this rule. - 'import/namespace': ['error', { allowComputed: true }], - 'import/order': [ - 'error', - { - groups: [['index', 'sibling', 'parent', 'internal', 'external', 'builtin']], - 'newlines-between': 'never', - }, - ], - - 'react-hooks/rules-of-hooks': 'error', - 'react-hooks/exhaustive-deps': ['error', { additionalHooks: 'useEnhancedEffect' }], }, overrides: [ { @@ -124,7 +98,6 @@ module.exports = { rules: { // does not work with wildcard imports. Mistakes will throw at runtime anyway 'import/named': 'off', - // 'no-restricted-imports': [ 'error', { @@ -191,5 +164,53 @@ module.exports = { 'react/prop-types': 'off', }, }, + { + files: ['*.d.ts'], + rules: { + 'import/export': 'off', // Not sure why it doesn't work + }, + }, + { + files: ['*.tsx'], + rules: { + 'no-restricted-imports': [ + 'error', + { + patterns: [ + '@material-ui/*/*/*/*', + '!@material-ui/core/test-utils/*', + '!@material-ui/utils/macros/*.macro', + ], + }, + ], // Allow deeper imports for TypeScript types. TODO? + 'react/prop-types': 'off', + }, + }, + { + files: ['*.spec.tsx', '*.spec.ts'], + rules: { + 'no-alert': 'off', + 'no-console': 'off', + 'no-empty-pattern': 'off', + 'no-lone-blocks': 'off', + 'no-shadow': 'off', + '@typescript-eslint/no-unused-expressions': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-use-before-define': 'off', + 'import/export': 'off', // Not sure why it doesn't work + 'import/prefer-default-export': 'off', + 'jsx-a11y/anchor-has-content': 'off', + 'jsx-a11y/anchor-is-valid': 'off', + 'jsx-a11y/tabindex-no-positive': 'off', + 'react/default-props-match-prop-types': 'off', + 'react/no-access-state-in-setstate': 'off', + 'react/no-unused-prop-types': 'off', + 'react/prefer-stateless-function': 'off', + 'react/prop-types': 'off', + 'react/require-default-props': 'off', + 'react/state-in-constructor': 'off', + 'react/static-property-placement': 'off', + }, + }, ], }; diff --git a/docs/scripts/buildApi.js b/docs/scripts/buildApi.js index 96dc7dc22ab569..e6e982e2038c3c 100644 --- a/docs/scripts/buildApi.js +++ b/docs/scripts/buildApi.js @@ -2,7 +2,6 @@ import * as babel from '@babel/core'; import traverse from '@babel/traverse'; import { mkdirSync, readFileSync, writeFileSync } from 'fs'; -import { getLineFeed } from './helpers'; import { rewriteUrlForNextExport } from 'next/dist/next-server/lib/router/rewrite-url-for-export'; import path from 'path'; import kebabCase from 'lodash/kebabCase'; @@ -11,6 +10,7 @@ import { defaultHandlers, parse as docgenParse } from 'react-docgen'; import remark from 'remark'; import remarkVisit from 'unist-util-visit'; import * as yargs from 'yargs'; +import { getLineFeed } from './helpers'; import muiDefaultPropsHandler from '../src/modules/utils/defaultPropsHandler'; import generateMarkdown from '../src/modules/utils/generateMarkdown'; import { findPagesMarkdown, findComponents } from '../src/modules/utils/find'; diff --git a/docs/src/modules/components/AppDrawer.js b/docs/src/modules/components/AppDrawer.js index d63d9629470f0b..e3444694af1a61 100644 --- a/docs/src/modules/components/AppDrawer.js +++ b/docs/src/modules/components/AppDrawer.js @@ -84,7 +84,7 @@ function renderNavItems(options) { return ( {pages.reduce( - // eslint-disable-next-line no-use-before-define + // eslint-disable-next-line @typescript-eslint/no-use-before-define (items, page) => reduceChildRoutes({ items, page, ...params }), [], )} @@ -158,6 +158,7 @@ function AppDrawer(props) { href={`https://material-ui.com${languagePrefix}/versions/`} onClick={onClose} > + {/* eslint-disable-next-line material-ui/no-hardcoded-labels -- version string is untranslatable */} {`v${process.env.LIB_VERSION}`} ) : null} diff --git a/docs/src/modules/components/AppFrame.js b/docs/src/modules/components/AppFrame.js index c9ae3453455466..a089d0415ecf3c 100644 --- a/docs/src/modules/components/AppFrame.js +++ b/docs/src/modules/components/AppFrame.js @@ -273,7 +273,7 @@ function AppFrame(props) { hrefLang="en" onClick={handleLanguageMenuClose} > - {`${t('helpToTranslate')}`} + {t('helpToTranslate')} diff --git a/docs/src/modules/components/HighlightedCode.js b/docs/src/modules/components/HighlightedCode.js index ef360cec17e5e9..900ceb15d91c67 100644 --- a/docs/src/modules/components/HighlightedCode.js +++ b/docs/src/modules/components/HighlightedCode.js @@ -1,7 +1,7 @@ import * as React from 'react'; import * as PropTypes from 'prop-types'; -import MarkdownElement from './MarkdownElement'; import prism from 'docs/src/modules/utils/prism'; +import MarkdownElement from './MarkdownElement'; const HighlightedCode = React.forwardRef(function HighlightedCode(props, ref) { const { code, language, ...other } = props; diff --git a/docs/src/modules/components/TopLayoutBlog.js b/docs/src/modules/components/TopLayoutBlog.js index 4f696c37860dee..e16c81225ead3d 100644 --- a/docs/src/modules/components/TopLayoutBlog.js +++ b/docs/src/modules/components/TopLayoutBlog.js @@ -58,6 +58,7 @@ function TopLayoutBlog(props) { color="textSecondary" className={classes.back} > + {/* eslint-disable-next-line material-ui/no-hardcoded-labels */} {'< Back to blog'} {rendered.map((chunk, index) => { diff --git a/docs/src/modules/utils/generateMarkdown.js b/docs/src/modules/utils/generateMarkdown.js index e4fe4a949653fd..b60dcb32e0a6af 100644 --- a/docs/src/modules/utils/generateMarkdown.js +++ b/docs/src/modules/utils/generateMarkdown.js @@ -2,8 +2,8 @@ import { parse as parseDoctrine } from 'doctrine'; import * as recast from 'recast'; import { parse as docgenParse } from 'react-docgen'; import { rewriteUrlForNextExport } from 'next/dist/next-server/lib/router/rewrite-url-for-export'; -import { pageToTitle } from './helpers'; import { SOURCE_CODE_ROOT_URL, LANGUAGES_IN_PROGRESS } from 'docs/src/modules/constants'; +import { pageToTitle } from './helpers'; const PATH_REPLACE_REGEX = /\\/g; const PATH_SEPARATOR = '/'; diff --git a/docs/src/modules/utils/getDemoConfig.js b/docs/src/modules/utils/getDemoConfig.js index b4db506d3500e7..a159fc156cdaeb 100644 --- a/docs/src/modules/utils/getDemoConfig.js +++ b/docs/src/modules/utils/getDemoConfig.js @@ -1,5 +1,5 @@ -import { getDependencies } from './helpers'; import { CODE_VARIANTS } from 'docs/src/modules/constants'; +import { getDependencies } from './helpers'; function jsDemo(demoData) { return { diff --git a/docs/src/pages/components/autocomplete/CheckboxesTags.js b/docs/src/pages/components/autocomplete/CheckboxesTags.js index 4c02234e785b5f..f02980c9a2bc3e 100644 --- a/docs/src/pages/components/autocomplete/CheckboxesTags.js +++ b/docs/src/pages/components/autocomplete/CheckboxesTags.js @@ -1,5 +1,4 @@ -/* eslint-disable no-use-before-define */ - +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Checkbox from '@material-ui/core/Checkbox'; import TextField from '@material-ui/core/TextField'; diff --git a/docs/src/pages/components/autocomplete/CheckboxesTags.tsx b/docs/src/pages/components/autocomplete/CheckboxesTags.tsx index 4c02234e785b5f..f02980c9a2bc3e 100644 --- a/docs/src/pages/components/autocomplete/CheckboxesTags.tsx +++ b/docs/src/pages/components/autocomplete/CheckboxesTags.tsx @@ -1,5 +1,4 @@ -/* eslint-disable no-use-before-define */ - +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Checkbox from '@material-ui/core/Checkbox'; import TextField from '@material-ui/core/TextField'; diff --git a/docs/src/pages/components/autocomplete/ComboBox.js b/docs/src/pages/components/autocomplete/ComboBox.js index beaed886add60a..50a6dc5cc03194 100644 --- a/docs/src/pages/components/autocomplete/ComboBox.js +++ b/docs/src/pages/components/autocomplete/ComboBox.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/ComboBox.tsx b/docs/src/pages/components/autocomplete/ComboBox.tsx index beaed886add60a..50a6dc5cc03194 100644 --- a/docs/src/pages/components/autocomplete/ComboBox.tsx +++ b/docs/src/pages/components/autocomplete/ComboBox.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/CountrySelect.js b/docs/src/pages/components/autocomplete/CountrySelect.js index 2ec63bb3cd2e35..b2fe8317808e60 100644 --- a/docs/src/pages/components/autocomplete/CountrySelect.js +++ b/docs/src/pages/components/autocomplete/CountrySelect.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/CountrySelect.tsx b/docs/src/pages/components/autocomplete/CountrySelect.tsx index 99a4445254b4ba..a93ab362fe9739 100644 --- a/docs/src/pages/components/autocomplete/CountrySelect.tsx +++ b/docs/src/pages/components/autocomplete/CountrySelect.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/CustomizedHook.js b/docs/src/pages/components/autocomplete/CustomizedHook.js index 017010dc52e5b1..e4d12ba5686f3c 100644 --- a/docs/src/pages/components/autocomplete/CustomizedHook.js +++ b/docs/src/pages/components/autocomplete/CustomizedHook.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import useAutocomplete from '@material-ui/lab/useAutocomplete'; import NoSsr from '@material-ui/core/NoSsr'; diff --git a/docs/src/pages/components/autocomplete/CustomizedHook.tsx b/docs/src/pages/components/autocomplete/CustomizedHook.tsx index c8f376f67a3210..52eedc7b40185b 100644 --- a/docs/src/pages/components/autocomplete/CustomizedHook.tsx +++ b/docs/src/pages/components/autocomplete/CustomizedHook.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import useAutocomplete from '@material-ui/lab/useAutocomplete'; import NoSsr from '@material-ui/core/NoSsr'; diff --git a/docs/src/pages/components/autocomplete/DisabledOptions.js b/docs/src/pages/components/autocomplete/DisabledOptions.js index 0eac30c783d45b..01e172f2e9ac27 100644 --- a/docs/src/pages/components/autocomplete/DisabledOptions.js +++ b/docs/src/pages/components/autocomplete/DisabledOptions.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/DisabledOptions.tsx b/docs/src/pages/components/autocomplete/DisabledOptions.tsx index 0eac30c783d45b..01e172f2e9ac27 100644 --- a/docs/src/pages/components/autocomplete/DisabledOptions.tsx +++ b/docs/src/pages/components/autocomplete/DisabledOptions.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/Filter.js b/docs/src/pages/components/autocomplete/Filter.js index 794dd8fd126fbd..cb4495b8029f86 100644 --- a/docs/src/pages/components/autocomplete/Filter.js +++ b/docs/src/pages/components/autocomplete/Filter.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete, { diff --git a/docs/src/pages/components/autocomplete/Filter.tsx b/docs/src/pages/components/autocomplete/Filter.tsx index 57d2eaa2590df1..44775b6927cda0 100644 --- a/docs/src/pages/components/autocomplete/Filter.tsx +++ b/docs/src/pages/components/autocomplete/Filter.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete, { diff --git a/docs/src/pages/components/autocomplete/FixedTags.js b/docs/src/pages/components/autocomplete/FixedTags.js index 3f96ea41c26083..17b932a4a60756 100644 --- a/docs/src/pages/components/autocomplete/FixedTags.js +++ b/docs/src/pages/components/autocomplete/FixedTags.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Chip from '@material-ui/core/Chip'; import TextField from '@material-ui/core/TextField'; diff --git a/docs/src/pages/components/autocomplete/FixedTags.tsx b/docs/src/pages/components/autocomplete/FixedTags.tsx index 3f96ea41c26083..17b932a4a60756 100644 --- a/docs/src/pages/components/autocomplete/FixedTags.tsx +++ b/docs/src/pages/components/autocomplete/FixedTags.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Chip from '@material-ui/core/Chip'; import TextField from '@material-ui/core/TextField'; diff --git a/docs/src/pages/components/autocomplete/FreeSolo.js b/docs/src/pages/components/autocomplete/FreeSolo.js index de47418746880f..6c846ecc569688 100644 --- a/docs/src/pages/components/autocomplete/FreeSolo.js +++ b/docs/src/pages/components/autocomplete/FreeSolo.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/FreeSolo.tsx b/docs/src/pages/components/autocomplete/FreeSolo.tsx index de47418746880f..6c846ecc569688 100644 --- a/docs/src/pages/components/autocomplete/FreeSolo.tsx +++ b/docs/src/pages/components/autocomplete/FreeSolo.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/FreeSoloCreateOption.js b/docs/src/pages/components/autocomplete/FreeSoloCreateOption.js index 31c5ac67457f24..438a1458ecb789 100644 --- a/docs/src/pages/components/autocomplete/FreeSoloCreateOption.js +++ b/docs/src/pages/components/autocomplete/FreeSoloCreateOption.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete, { diff --git a/docs/src/pages/components/autocomplete/FreeSoloCreateOption.tsx b/docs/src/pages/components/autocomplete/FreeSoloCreateOption.tsx index 28bcbabebbbea7..af094d6402c3bd 100644 --- a/docs/src/pages/components/autocomplete/FreeSoloCreateOption.tsx +++ b/docs/src/pages/components/autocomplete/FreeSoloCreateOption.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete, { diff --git a/docs/src/pages/components/autocomplete/FreeSoloCreateOptionDialog.js b/docs/src/pages/components/autocomplete/FreeSoloCreateOptionDialog.js index 161f81e4ed475d..aa22f2b45be5f3 100644 --- a/docs/src/pages/components/autocomplete/FreeSoloCreateOptionDialog.js +++ b/docs/src/pages/components/autocomplete/FreeSoloCreateOptionDialog.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Dialog from '@material-ui/core/Dialog'; diff --git a/docs/src/pages/components/autocomplete/FreeSoloCreateOptionDialog.tsx b/docs/src/pages/components/autocomplete/FreeSoloCreateOptionDialog.tsx index e6aaf17a02849a..e094e269987927 100644 --- a/docs/src/pages/components/autocomplete/FreeSoloCreateOptionDialog.tsx +++ b/docs/src/pages/components/autocomplete/FreeSoloCreateOptionDialog.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Dialog from '@material-ui/core/Dialog'; diff --git a/docs/src/pages/components/autocomplete/GitHubLabel.js b/docs/src/pages/components/autocomplete/GitHubLabel.js index 6ff1b29598f3fb..22f26611845ba3 100644 --- a/docs/src/pages/components/autocomplete/GitHubLabel.js +++ b/docs/src/pages/components/autocomplete/GitHubLabel.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import { useTheme, fade, makeStyles } from '@material-ui/core/styles'; import Popper from '@material-ui/core/Popper'; diff --git a/docs/src/pages/components/autocomplete/GitHubLabel.tsx b/docs/src/pages/components/autocomplete/GitHubLabel.tsx index 17b042bd1c8394..81472c1f6f2972 100644 --- a/docs/src/pages/components/autocomplete/GitHubLabel.tsx +++ b/docs/src/pages/components/autocomplete/GitHubLabel.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import { useTheme, diff --git a/docs/src/pages/components/autocomplete/Grouped.js b/docs/src/pages/components/autocomplete/Grouped.js index eefb2c02d19b55..a22f0e88eede9f 100644 --- a/docs/src/pages/components/autocomplete/Grouped.js +++ b/docs/src/pages/components/autocomplete/Grouped.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/Grouped.tsx b/docs/src/pages/components/autocomplete/Grouped.tsx index eefb2c02d19b55..a22f0e88eede9f 100644 --- a/docs/src/pages/components/autocomplete/Grouped.tsx +++ b/docs/src/pages/components/autocomplete/Grouped.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/Highlights.js b/docs/src/pages/components/autocomplete/Highlights.js index b790db6b07178b..380c38bf2ab4b7 100644 --- a/docs/src/pages/components/autocomplete/Highlights.js +++ b/docs/src/pages/components/autocomplete/Highlights.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/Highlights.tsx b/docs/src/pages/components/autocomplete/Highlights.tsx index b790db6b07178b..380c38bf2ab4b7 100644 --- a/docs/src/pages/components/autocomplete/Highlights.tsx +++ b/docs/src/pages/components/autocomplete/Highlights.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/LimitTags.js b/docs/src/pages/components/autocomplete/LimitTags.js index 854b10c1ef52f4..5b9563ff472991 100644 --- a/docs/src/pages/components/autocomplete/LimitTags.js +++ b/docs/src/pages/components/autocomplete/LimitTags.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Autocomplete from '@material-ui/lab/Autocomplete'; import { makeStyles } from '@material-ui/core/styles'; diff --git a/docs/src/pages/components/autocomplete/LimitTags.tsx b/docs/src/pages/components/autocomplete/LimitTags.tsx index c50853e6521130..4a81f89da07ca7 100644 --- a/docs/src/pages/components/autocomplete/LimitTags.tsx +++ b/docs/src/pages/components/autocomplete/LimitTags.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Autocomplete from '@material-ui/lab/Autocomplete'; import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; diff --git a/docs/src/pages/components/autocomplete/Playground.js b/docs/src/pages/components/autocomplete/Playground.js index fb00fc177621d7..55945369d8bfc6 100644 --- a/docs/src/pages/components/autocomplete/Playground.js +++ b/docs/src/pages/components/autocomplete/Playground.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/Playground.tsx b/docs/src/pages/components/autocomplete/Playground.tsx index 9b68011e07738c..411248bddcdfb1 100644 --- a/docs/src/pages/components/autocomplete/Playground.tsx +++ b/docs/src/pages/components/autocomplete/Playground.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import TextField from '@material-ui/core/TextField'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/Sizes.js b/docs/src/pages/components/autocomplete/Sizes.js index 51efce97819471..0c620d5f07090e 100644 --- a/docs/src/pages/components/autocomplete/Sizes.js +++ b/docs/src/pages/components/autocomplete/Sizes.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Chip from '@material-ui/core/Chip'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/Sizes.tsx b/docs/src/pages/components/autocomplete/Sizes.tsx index e1d949e69340f6..494df6bee76fe8 100644 --- a/docs/src/pages/components/autocomplete/Sizes.tsx +++ b/docs/src/pages/components/autocomplete/Sizes.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Chip from '@material-ui/core/Chip'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/Tags.js b/docs/src/pages/components/autocomplete/Tags.js index 134f26487defe2..a92b9b240b906a 100644 --- a/docs/src/pages/components/autocomplete/Tags.js +++ b/docs/src/pages/components/autocomplete/Tags.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Chip from '@material-ui/core/Chip'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/Tags.tsx b/docs/src/pages/components/autocomplete/Tags.tsx index 542bf94d3aa12c..6a82dcd793b598 100644 --- a/docs/src/pages/components/autocomplete/Tags.tsx +++ b/docs/src/pages/components/autocomplete/Tags.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import Chip from '@material-ui/core/Chip'; import Autocomplete from '@material-ui/lab/Autocomplete'; diff --git a/docs/src/pages/components/autocomplete/UseAutocomplete.js b/docs/src/pages/components/autocomplete/UseAutocomplete.js index f120d603555dfb..ffc0821a55a295 100644 --- a/docs/src/pages/components/autocomplete/UseAutocomplete.js +++ b/docs/src/pages/components/autocomplete/UseAutocomplete.js @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import useAutocomplete from '@material-ui/lab/useAutocomplete'; import { makeStyles } from '@material-ui/core/styles'; diff --git a/docs/src/pages/components/autocomplete/UseAutocomplete.tsx b/docs/src/pages/components/autocomplete/UseAutocomplete.tsx index 913da9a6cd0d8a..3c41ae7195adb3 100644 --- a/docs/src/pages/components/autocomplete/UseAutocomplete.tsx +++ b/docs/src/pages/components/autocomplete/UseAutocomplete.tsx @@ -1,4 +1,4 @@ -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ import React from 'react'; import useAutocomplete from '@material-ui/lab/useAutocomplete'; import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; diff --git a/docs/src/pages/components/tables/EnhancedTable.js b/docs/src/pages/components/tables/EnhancedTable.js index 85e3c8901246e5..250b60213bc258 100644 --- a/docs/src/pages/components/tables/EnhancedTable.js +++ b/docs/src/pages/components/tables/EnhancedTable.js @@ -107,6 +107,21 @@ const headCells = [ }, ]; +const useStyles = makeStyles((theme) => ({ + root: { + width: '100%', + }, + paper: { + width: '100%', + marginBottom: theme.spacing(2), + }, + table: { + minWidth: 750, + }, + // TODO fix #20379. + sortSpan: visuallyHidden, +})); + function EnhancedTableHead(props) { const { classes, @@ -241,21 +256,6 @@ EnhancedTableToolbar.propTypes = { numSelected: PropTypes.number.isRequired, }; -const useStyles = makeStyles((theme) => ({ - root: { - width: '100%', - }, - paper: { - width: '100%', - marginBottom: theme.spacing(2), - }, - table: { - minWidth: 750, - }, - // TODO fix #20379. - sortSpan: visuallyHidden, -})); - export default function EnhancedTable() { const classes = useStyles(); const [order, setOrder] = React.useState('asc'); diff --git a/docs/src/pages/components/tables/EnhancedTable.tsx b/docs/src/pages/components/tables/EnhancedTable.tsx index a116b80a64cc2d..796f2572324f5b 100644 --- a/docs/src/pages/components/tables/EnhancedTable.tsx +++ b/docs/src/pages/components/tables/EnhancedTable.tsx @@ -141,6 +141,23 @@ const headCells: HeadCell[] = [ }, ]; +const useStyles = makeStyles((theme: Theme) => + createStyles({ + root: { + width: '100%', + }, + paper: { + width: '100%', + marginBottom: theme.spacing(2), + }, + table: { + minWidth: 750, + }, + // TODO fix #20379. + sortSpan: visuallyHidden as CSSProperties, + }), +); + interface EnhancedTableProps { classes: ReturnType; numSelected: number; @@ -281,23 +298,6 @@ const EnhancedTableToolbar = (props: EnhancedTableToolbarProps) => { ); }; -const useStyles = makeStyles((theme: Theme) => - createStyles({ - root: { - width: '100%', - }, - paper: { - width: '100%', - marginBottom: theme.spacing(2), - }, - table: { - minWidth: 750, - }, - // TODO fix #20379. - sortSpan: visuallyHidden as CSSProperties, - }), -); - export default function EnhancedTable() { const classes = useStyles(); const [order, setOrder] = React.useState('asc'); diff --git a/docs/src/pages/customization/color/ColorTool.js b/docs/src/pages/customization/color/ColorTool.js index caea9818f95ca1..e67b48d20f9b30 100644 --- a/docs/src/pages/customization/color/ColorTool.js +++ b/docs/src/pages/customization/color/ColorTool.js @@ -11,8 +11,8 @@ import Button from '@material-ui/core/Button'; import CheckIcon from '@material-ui/icons/Check'; import Slider from '@material-ui/core/Slider'; import { capitalize } from '@material-ui/core/utils'; -import ColorDemo from './ColorDemo'; import { DispatchContext } from 'docs/src/modules/components/ThemeContext'; +import ColorDemo from './ColorDemo'; const defaults = { primary: '#2196f3', diff --git a/docs/src/pages/customization/components/ClassNames.tsx b/docs/src/pages/customization/components/ClassNames.tsx index d356efde74b96f..972139f876647b 100644 --- a/docs/src/pages/customization/components/ClassNames.tsx +++ b/docs/src/pages/customization/components/ClassNames.tsx @@ -3,11 +3,6 @@ import clsx from 'clsx'; import Button from '@material-ui/core/Button'; import { withStyles, WithStyles } from '@material-ui/core/styles'; -interface Props extends WithStyles { - children?: React.ReactNode; - className?: string; -} - // We can inject some CSS into the DOM. const styles = { root: { @@ -21,6 +16,11 @@ const styles = { }, }; +interface Props extends WithStyles { + children?: React.ReactNode; + className?: string; +} + function ClassNames(props: Props) { const { classes, children, className, ...other } = props; diff --git a/docs/src/pages/customization/components/DynamicCSS.tsx b/docs/src/pages/customization/components/DynamicCSS.tsx index aee3e3e159d243..3d8df099c8181a 100644 --- a/docs/src/pages/customization/components/DynamicCSS.tsx +++ b/docs/src/pages/customization/components/DynamicCSS.tsx @@ -16,10 +16,6 @@ interface ColorsMapping { [key: string]: any; } -interface ButtonStyles extends WithStyles { - color: string; -} - // Like https://github.com/brunobertolini/styled-by const styledBy = (property: string, mapping: ColorsMapping) => ( props: Styles, @@ -43,6 +39,10 @@ const styles = { }, }; +interface ButtonStyles extends WithStyles { + color: string; +} + const StyledButton = withStyles( styles, )(({ classes, color, ...other }: ButtonStyles) => ( diff --git a/docs/src/pages/customization/components/DynamicCSSVariables.js b/docs/src/pages/customization/components/DynamicCSSVariables.js index e15d0b73b7ff54..e9d65d6b1981c6 100644 --- a/docs/src/pages/customization/components/DynamicCSSVariables.js +++ b/docs/src/pages/customization/components/DynamicCSSVariables.js @@ -51,7 +51,7 @@ export default function DynamicCSSVariables() { label="Blue" /> - {'CSS variables'} + CSS variables ); diff --git a/docs/src/pages/customization/components/DynamicCSSVariables.tsx b/docs/src/pages/customization/components/DynamicCSSVariables.tsx index d239dd21fb0ec3..537017d0e557b8 100644 --- a/docs/src/pages/customization/components/DynamicCSSVariables.tsx +++ b/docs/src/pages/customization/components/DynamicCSSVariables.tsx @@ -51,7 +51,7 @@ export default function DynamicCSSVariables() { label="Blue" /> - {'CSS variables'} + CSS variables ); diff --git a/docs/src/pages/customization/components/DynamicClassName.js b/docs/src/pages/customization/components/DynamicClassName.js index 57c55e5d179edf..54a93a2d6a1389 100644 --- a/docs/src/pages/customization/components/DynamicClassName.js +++ b/docs/src/pages/customization/components/DynamicClassName.js @@ -47,7 +47,7 @@ export default function DynamicClassName() { [classes.buttonBlue]: color === 'blue', })} > - {'Class name branch'} + Class name branch ); diff --git a/docs/src/pages/customization/components/DynamicClassName.tsx b/docs/src/pages/customization/components/DynamicClassName.tsx index f2d3f83f42c512..6fd37835af69d0 100644 --- a/docs/src/pages/customization/components/DynamicClassName.tsx +++ b/docs/src/pages/customization/components/DynamicClassName.tsx @@ -47,7 +47,7 @@ export default function DynamicClassName() { [classes.buttonBlue]: color === 'blue', })} > - {'Class name branch'} + Class name branch ); diff --git a/docs/src/pages/customization/components/DynamicInlineStyle.js b/docs/src/pages/customization/components/DynamicInlineStyle.js index f382e3bf8dcf2b..b8f6214b59ffc0 100644 --- a/docs/src/pages/customization/components/DynamicInlineStyle.js +++ b/docs/src/pages/customization/components/DynamicInlineStyle.js @@ -45,7 +45,7 @@ export default function DynamicInlineStyle() { ...(color === 'blue' ? styles.buttonBlue : {}), }} > - {'dynamic inline-style'} + dynamic inline-style ); diff --git a/docs/src/pages/customization/components/DynamicInlineStyle.tsx b/docs/src/pages/customization/components/DynamicInlineStyle.tsx index 11478d48c4dbad..9584bc297dcb7c 100644 --- a/docs/src/pages/customization/components/DynamicInlineStyle.tsx +++ b/docs/src/pages/customization/components/DynamicInlineStyle.tsx @@ -45,7 +45,7 @@ export default function DynamicInlineStyle() { ...(color === 'blue' ? styles.buttonBlue : {}), }} > - {'dynamic inline-style'} + dynamic inline-style ); diff --git a/docs/src/pages/customization/components/DynamicThemeNesting.js b/docs/src/pages/customization/components/DynamicThemeNesting.js index 2e8b35070ddb71..41c3fc6ebdf872 100644 --- a/docs/src/pages/customization/components/DynamicThemeNesting.js +++ b/docs/src/pages/customization/components/DynamicThemeNesting.js @@ -41,7 +41,7 @@ export default function DynamicThemeNesting() { /> - {'Theme nesting'} + Theme nesting diff --git a/docs/src/pages/customization/components/DynamicThemeNesting.tsx b/docs/src/pages/customization/components/DynamicThemeNesting.tsx index a7de6b26c8820b..1dc7c8a81926c0 100644 --- a/docs/src/pages/customization/components/DynamicThemeNesting.tsx +++ b/docs/src/pages/customization/components/DynamicThemeNesting.tsx @@ -41,7 +41,7 @@ export default function DynamicThemeNesting() { /> theme={theme}> - {'Theme nesting'} + Theme nesting diff --git a/docs/src/pages/guides/composition/ListRouter.tsx b/docs/src/pages/guides/composition/ListRouter.tsx index 8587398dab15d3..0dcf0a488c90a1 100644 --- a/docs/src/pages/guides/composition/ListRouter.tsx +++ b/docs/src/pages/guides/composition/ListRouter.tsx @@ -17,9 +17,9 @@ import { import { Omit } from '@material-ui/types'; interface ListItemLinkProps { - icon?: React.ReactElement; - primary: string; to: string; + primary: string; + icon?: React.ReactElement; } function ListItemLink(props: ListItemLinkProps) { diff --git a/docs/src/pages/premium-themes/onepirate/ForgotPassword.js b/docs/src/pages/premium-themes/onepirate/ForgotPassword.js index fad04f2fcf7de2..33ff4052a91a5e 100644 --- a/docs/src/pages/premium-themes/onepirate/ForgotPassword.js +++ b/docs/src/pages/premium-themes/onepirate/ForgotPassword.js @@ -1,3 +1,4 @@ +/* eslint-disable import/order */ import withRoot from './modules/withRoot'; // --- Post bootstrap ----- import React from 'react'; diff --git a/docs/src/pages/premium-themes/onepirate/Home.js b/docs/src/pages/premium-themes/onepirate/Home.js index 613f0416e87f8f..2ac798c88371d4 100644 --- a/docs/src/pages/premium-themes/onepirate/Home.js +++ b/docs/src/pages/premium-themes/onepirate/Home.js @@ -1,3 +1,4 @@ +/* eslint-disable import/order */ import withRoot from './modules/withRoot'; // --- Post bootstrap ----- import React from 'react'; diff --git a/docs/src/pages/premium-themes/onepirate/Privacy.js b/docs/src/pages/premium-themes/onepirate/Privacy.js index 9636759dea6864..06432365e0adfc 100644 --- a/docs/src/pages/premium-themes/onepirate/Privacy.js +++ b/docs/src/pages/premium-themes/onepirate/Privacy.js @@ -1,3 +1,4 @@ +/* eslint-disable import/order */ import withRoot from './modules/withRoot'; // --- Post bootstrap ----- import React from 'react'; diff --git a/docs/src/pages/premium-themes/onepirate/SignIn.js b/docs/src/pages/premium-themes/onepirate/SignIn.js index 89c4c41e988e6a..477fabffc7725a 100644 --- a/docs/src/pages/premium-themes/onepirate/SignIn.js +++ b/docs/src/pages/premium-themes/onepirate/SignIn.js @@ -1,3 +1,4 @@ +/* eslint-disable import/order */ import withRoot from './modules/withRoot'; // --- Post bootstrap ----- import React from 'react'; diff --git a/docs/src/pages/premium-themes/onepirate/SignUp.js b/docs/src/pages/premium-themes/onepirate/SignUp.js index 11f4ce8b88e202..5f9b2db3204814 100644 --- a/docs/src/pages/premium-themes/onepirate/SignUp.js +++ b/docs/src/pages/premium-themes/onepirate/SignUp.js @@ -1,3 +1,4 @@ +/* eslint-disable import/order */ import withRoot from './modules/withRoot'; // --- Post bootstrap ----- import React from 'react'; diff --git a/docs/src/pages/premium-themes/onepirate/Terms.js b/docs/src/pages/premium-themes/onepirate/Terms.js index 4792365078220c..a7c29f4d19a9f8 100644 --- a/docs/src/pages/premium-themes/onepirate/Terms.js +++ b/docs/src/pages/premium-themes/onepirate/Terms.js @@ -1,3 +1,4 @@ +/* eslint-disable import/order */ import withRoot from './modules/withRoot'; // --- Post bootstrap ----- import React from 'react'; diff --git a/docs/src/pages/premium-themes/paperbase/Paperbase.js b/docs/src/pages/premium-themes/paperbase/Paperbase.js index 2b28c6551419ae..a453d15b91a7d3 100644 --- a/docs/src/pages/premium-themes/paperbase/Paperbase.js +++ b/docs/src/pages/premium-themes/paperbase/Paperbase.js @@ -20,8 +20,7 @@ function Copyright() { Your Website {' '} - {new Date().getFullYear()} - {'.'} + {new Date().getFullYear()}. ); } diff --git a/docs/src/pages/premium-themes/paperbase/Paperbase.tsx b/docs/src/pages/premium-themes/paperbase/Paperbase.tsx index e165251f021189..c4875022b49c6f 100644 --- a/docs/src/pages/premium-themes/paperbase/Paperbase.tsx +++ b/docs/src/pages/premium-themes/paperbase/Paperbase.tsx @@ -21,8 +21,7 @@ function Copyright() { Your Website {' '} - {new Date().getFullYear()} - {'.'} + {new Date().getFullYear()}. ); } diff --git a/docs/src/pages/styles/advanced/Theming.js b/docs/src/pages/styles/advanced/Theming.js index fa10da8dfd0fb7..155773186263dc 100644 --- a/docs/src/pages/styles/advanced/Theming.js +++ b/docs/src/pages/styles/advanced/Theming.js @@ -1,6 +1,10 @@ import React from 'react'; import { ThemeProvider, makeStyles } from '@material-ui/core/styles'; +const themeInstance = { + background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)', +}; + const useStyles = makeStyles((theme) => ({ root: { background: theme.background, @@ -24,10 +28,6 @@ function DeepChild() { ); } -const themeInstance = { - background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)', -}; - export default function Theming() { return ( diff --git a/docs/src/pages/styles/advanced/Theming.tsx b/docs/src/pages/styles/advanced/Theming.tsx index bc5e7ab1e604a0..3914898745e460 100644 --- a/docs/src/pages/styles/advanced/Theming.tsx +++ b/docs/src/pages/styles/advanced/Theming.tsx @@ -1,6 +1,10 @@ import React from 'react'; import { ThemeProvider, makeStyles } from '@material-ui/core/styles'; +const themeInstance = { + background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)', +}; + const useStyles = makeStyles((theme: typeof themeInstance) => ({ root: { background: theme.background, @@ -24,10 +28,6 @@ function DeepChild() { ); } -const themeInstance = { - background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)', -}; - export default function Theming() { return ( diff --git a/docs/webpackBaseConfig.js b/docs/webpackBaseConfig.js index fdfe2cc131d421..10d03dea827cba 100644 --- a/docs/webpackBaseConfig.js +++ b/docs/webpackBaseConfig.js @@ -16,7 +16,7 @@ module.exports = { '@material-ui/utils': path.resolve(__dirname, '../packages/material-ui-utils/src'), docs: path.resolve(__dirname, '../docs'), }, - extensions: ['.js', '.ts'], + extensions: ['.js', '.ts', '.tsx', '.d.ts'], }, output: { path: path.join(__dirname, 'build'), @@ -26,7 +26,7 @@ module.exports = { module: { rules: [ { - test: /\.(js|ts)$/, + test: /\.(js|ts|tsx)$/, exclude: /node_modules/, loader: 'babel-loader', query: { diff --git a/examples/create-react-app-with-typescript/src/App.tsx b/examples/create-react-app-with-typescript/src/App.tsx index cbce51d807ae7f..39b764a0e348c0 100644 --- a/examples/create-react-app-with-typescript/src/App.tsx +++ b/examples/create-react-app-with-typescript/src/App.tsx @@ -12,8 +12,7 @@ function Copyright() { Your Website {' '} - {new Date().getFullYear()} - {'.'} + {new Date().getFullYear()}. ); } diff --git a/examples/create-react-app-with-typescript/src/theme.tsx b/examples/create-react-app-with-typescript/src/theme.tsx index f9c08b49759c16..405e84b54e976a 100644 --- a/examples/create-react-app-with-typescript/src/theme.tsx +++ b/examples/create-react-app-with-typescript/src/theme.tsx @@ -1,5 +1,5 @@ -import red from '@material-ui/core/colors/red'; import { createMuiTheme } from '@material-ui/core/styles'; +import { red } from '@material-ui/core/colors'; // A custom theme for this app const theme = createMuiTheme({ diff --git a/examples/nextjs-with-typescript/src/Copyright.tsx b/examples/nextjs-with-typescript/src/Copyright.tsx index 5d4e8f33e91f0b..62cc86fe418ed9 100644 --- a/examples/nextjs-with-typescript/src/Copyright.tsx +++ b/examples/nextjs-with-typescript/src/Copyright.tsx @@ -9,8 +9,7 @@ export default function Copyright() { Your Website {' '} - {new Date().getFullYear()} - {'.'} + {new Date().getFullYear()}. ); } diff --git a/examples/nextjs-with-typescript/src/theme.tsx b/examples/nextjs-with-typescript/src/theme.tsx index f9e8c47d322cfc..21af17c750d59c 100644 --- a/examples/nextjs-with-typescript/src/theme.tsx +++ b/examples/nextjs-with-typescript/src/theme.tsx @@ -1,5 +1,5 @@ import { createMuiTheme } from '@material-ui/core/styles'; -import red from '@material-ui/core/colors/red'; +import { red } from '@material-ui/core/colors'; // Create a theme instance. const theme = createMuiTheme({ diff --git a/examples/nextjs/src/Copyright.js b/examples/nextjs/src/Copyright.js index 5d4e8f33e91f0b..62cc86fe418ed9 100644 --- a/examples/nextjs/src/Copyright.js +++ b/examples/nextjs/src/Copyright.js @@ -9,8 +9,7 @@ export default function Copyright() { Your Website {' '} - {new Date().getFullYear()} - {'.'} + {new Date().getFullYear()}. ); } diff --git a/package.json b/package.json index 6623a3d48c7e58..861714ff283703 100644 --- a/package.json +++ b/package.json @@ -25,9 +25,9 @@ "extract-error-codes": "lerna run --parallel extract-error-codes", "framer:build": "yarn workspace framer build", "jsonlint": "node scripts/jsonlint.js", - "lint": "eslint . --cache --report-unused-disable-directives", - "lint:ci": "eslint . --report-unused-disable-directives", - "lint:fix": "eslint . --cache --fix", + "lint": "eslint . --cache --report-unused-disable-directives --ext .js,.ts,.tsx", + "lint:ci": "eslint . --report-unused-disable-directives --ext .js,.ts,.tsx", + "lint:fix": "eslint . --cache --fix --ext .js,.ts,.tsx", "prettier": "node ./scripts/prettier.js", "prettier:all": "node ./scripts/prettier.js write", "size:snapshot": "node scripts/sizeSnapshot/create", @@ -58,10 +58,10 @@ "@babel/register": "^7.10.1", "@rollup/plugin-replace": "^2.3.1", "@testing-library/dom": "^7.0.3", - "@testing-library/react": "^10.0.1", "@testing-library/react-hooks": "3.3.0", - "@types/chai": "^4.2.3", + "@testing-library/react": "^10.0.1", "@types/chai-dom": "^0.0.10", + "@types/chai": "^4.2.3", "@types/enzyme": "^3.10.3", "@types/fs-extra": "^9.0.0", "@types/glob": "^7.1.1", @@ -71,9 +71,9 @@ "@types/prettier": "^2.0.0", "@types/react": "^16.9.3", "@types/sinon": "^9.0.0", + "@typescript-eslint/eslint-plugin": "^3.6.0", + "@typescript-eslint/parser": "^3.6.0", "argos-cli": "^0.3.0", - "babel-core": "^7.0.0-bridge.0", - "babel-eslint": "^10.0.3", "babel-loader": "^8.0.0", "babel-plugin-istanbul": "^6.0.0", "babel-plugin-macros": "^2.8.0", @@ -83,8 +83,8 @@ "babel-plugin-tester": "^9.0.0", "babel-plugin-transform-dev-warning": "^0.1.0", "babel-plugin-transform-react-remove-prop-types": "^0.4.21", - "chai": "^4.1.2", "chai-dom": "^1.8.1", + "chai": "^4.1.2", "chalk": "^4.0.0", "compression-webpack-plugin": "^4.0.0", "confusing-browser-globals": "^1.0.9", @@ -93,31 +93,31 @@ "danger": "^10.0.0", "dom-accessibility-api": "^0.4.3", "dtslint": "^3.2.0", - "enzyme": "^3.9.0", "enzyme-adapter-react-16": "^1.14.0", - "eslint": "^7.4.0", - "eslint-config-airbnb": "^18.2.0", + "enzyme": "^3.9.0", + "eslint-config-airbnb-typescript": "^8.0.2", "eslint-config-prettier": "^6.11.0", "eslint-import-resolver-webpack": "^0.12.2", "eslint-plugin-babel": "^5.3.1", "eslint-plugin-import": "^2.22.0", "eslint-plugin-jsx-a11y": "^6.3.1", "eslint-plugin-mocha": "^6.1.1", - "eslint-plugin-react": "^7.20.3", "eslint-plugin-react-hooks": "^4.0.7", + "eslint-plugin-react": "^7.20.3", + "eslint": "^7.4.0", "expect-puppeteer": "^4.3.0", "format-util": "^1.0.5", "fs-extra": "^9.0.0", - "glob": "^7.1.2", "glob-gitignore": "^1.0.11", + "glob": "^7.1.2", "jsdom": "^16.0.0", - "karma": "^5.0.1", "karma-browserstack-launcher": "~1.4.0", "karma-chrome-launcher": "^3.0.0", - "karma-mocha": "^2.0.0", "karma-mocha-reporter": "^2.2.5", + "karma-mocha": "^2.0.0", "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^4.0.2", + "karma": "^5.0.1", "lerna": "^3.16.4", "lodash": "^4.17.15", "mocha": "^8.0.1", @@ -127,18 +127,18 @@ "pretty-format-v24": "npm:pretty-format@24", "prop-types": "^15.7.2", "puppeteer": "^5.0.0", - "react": "^16.13.0", "react-dom": "^16.13.0", "react-test-renderer": "^16.13.0", + "react": "^16.13.0", "remark": "^12.0.0", "rimraf": "^3.0.0", - "rollup": "^2.10.8", "rollup-plugin-babel": "^4.3.3", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-size-snapshot": "^0.12.0", "rollup-plugin-terser": "^6.1.0", + "rollup": "^2.10.8", "sinon": "^9.0.0", "size-limit": "^0.21.0", "ts-node": "^8.3.0", @@ -147,8 +147,8 @@ "unist-util-visit": "^2.0.2", "url-loader": "^4.1.0", "vrtest-mui": "^0.3.3", - "webpack": "^4.41.0", "webpack-cli": "^3.3.9", + "webpack": "^4.41.0", "yargs": "^15.2.0", "yarn-deduplicate": "^2.0.0" }, diff --git a/packages/eslint-plugin-material-ui/package.json b/packages/eslint-plugin-material-ui/package.json index b3f17ed045ca4e..634594cbcfea53 100644 --- a/packages/eslint-plugin-material-ui/package.json +++ b/packages/eslint-plugin-material-ui/package.json @@ -9,7 +9,7 @@ }, "devDependencies": { "@types/eslint": "^7.2.0", - "babel-eslint": "^10.1.0" + "@typescript-eslint/parser": "^3.6.0" }, "scripts": { "test": "cd ../../ && cross-env NODE_ENV=test mocha 'packages/eslint-plugin-material-ui/**/*.test.js' --exclude '**/node_modules/**'" diff --git a/packages/eslint-plugin-material-ui/src/rules/disallow-active-elements-as-key-event-target.test.js b/packages/eslint-plugin-material-ui/src/rules/disallow-active-elements-as-key-event-target.test.js index 0967f3f95d6280..4dfdd54aae764d 100644 --- a/packages/eslint-plugin-material-ui/src/rules/disallow-active-elements-as-key-event-target.test.js +++ b/packages/eslint-plugin-material-ui/src/rules/disallow-active-elements-as-key-event-target.test.js @@ -1,7 +1,10 @@ const eslint = require('eslint'); const rule = require('./disallow-active-element-as-key-event-target'); -const ruleTester = new eslint.RuleTester({ parser: require.resolve('babel-eslint') }); +const ruleTester = new eslint.RuleTester({ + parser: require.resolve('@typescript-eslint/parser'), + parserOptions: { sourceType: 'module' }, +}); ruleTester.run('disallow-active-element-as-key-event-target', rule, { valid: [ "import { fireEvent } from 'test/utils/createClientRender';\nfireEvent.keyDown(getByRole('button'), { key: ' ' })", diff --git a/packages/eslint-plugin-material-ui/src/rules/docgen-ignore-before-comment.test.js b/packages/eslint-plugin-material-ui/src/rules/docgen-ignore-before-comment.test.js index 7c087d07106599..65fd1360ff4594 100644 --- a/packages/eslint-plugin-material-ui/src/rules/docgen-ignore-before-comment.test.js +++ b/packages/eslint-plugin-material-ui/src/rules/docgen-ignore-before-comment.test.js @@ -1,7 +1,7 @@ const eslint = require('eslint'); const rule = require('./docgen-ignore-before-comment'); -const ruleTester = new eslint.RuleTester(); +const ruleTester = new eslint.RuleTester({ parser: require.resolve('@typescript-eslint/parser') }); ruleTester.run('ignore-before-comment', rule, { valid: [ '\n/**\n * @ignore\n */\n', diff --git a/packages/eslint-plugin-material-ui/src/rules/no-hardcoded-labels.js b/packages/eslint-plugin-material-ui/src/rules/no-hardcoded-labels.js index 7d2cf50be87141..46e257cb993bcc 100644 --- a/packages/eslint-plugin-material-ui/src/rules/no-hardcoded-labels.js +++ b/packages/eslint-plugin-material-ui/src/rules/no-hardcoded-labels.js @@ -11,16 +11,38 @@ module.exports = { const { allow = [] } = context.options[0] || {}; const emojiRegex = createEmojiRegex(); + function valueViolatesRule(value) { + const sanitizedValue = typeof value === 'string' ? value.trim() : value; + const hasTranslateableContent = sanitizedValue !== '' && !emojiRegex.test(sanitizedValue); + + return hasTranslateableContent && !allow.includes(sanitizedValue); + } + return { + JSXExpressionContainer(node) { + if (node.parent.type === 'JSXElement') { + const isTemplateLiteral = node.expression.type === 'TemplateLiteral'; + const isStringLiteral = + node.expression.type === 'Literal' && typeof node.expression.value === 'string'; + + if ((isStringLiteral && valueViolatesRule(node.expression.value)) || isTemplateLiteral) { + context.report({ messageId: 'literal-label', node }); + } + } + }, + JSXText(node) { + if (node.parent.type === 'JSXElement') { + if (valueViolatesRule(node.value)) { + context.report({ messageId: 'literal-label', node }); + } + } + }, Literal(node) { const canLabelComponent = node.parent.type === 'JSXElement' || (node.parent.type === 'JSXAttribute' && ['aria-label'].includes(node.parent.name.name)); - const sanitizedValue = typeof node.value === 'string' ? node.value.trim() : node.value; - const hasTranslateableContent = sanitizedValue !== '' && !emojiRegex.test(sanitizedValue); - - if (canLabelComponent && hasTranslateableContent && !allow.includes(sanitizedValue)) { + if (canLabelComponent && valueViolatesRule(node.value)) { context.report({ messageId: 'literal-label', node }); } }, diff --git a/packages/eslint-plugin-material-ui/src/rules/no-hardcoded-labels.test.js b/packages/eslint-plugin-material-ui/src/rules/no-hardcoded-labels.test.js index b7972261af250e..bf437844932875 100644 --- a/packages/eslint-plugin-material-ui/src/rules/no-hardcoded-labels.test.js +++ b/packages/eslint-plugin-material-ui/src/rules/no-hardcoded-labels.test.js @@ -1,7 +1,12 @@ const eslint = require('eslint'); const rule = require('./no-hardcoded-labels'); -const ruleTester = new eslint.RuleTester({ parser: require.resolve('babel-eslint') }); +const ruleTester = new eslint.RuleTester({ + parser: require.resolve('@typescript-eslint/parser'), + parserOptions: { + ecmaFeatures: { jsx: true }, + }, +}); ruleTester.run('no-hardcoded-labels', rule, { valid: [ '{42}', @@ -12,10 +17,13 @@ ruleTester.run('no-hardcoded-labels', rule, { ' ', { code: 'Material-UI', options: [{ allow: 'Material-UI' }] }, ' ❤️', + `{t("a")}{' '}`, ], invalid: [ { code: '', errors: [{ messageId: 'literal-label' }] }, { code: 'test', errors: [{ messageId: 'literal-label' }] }, { code: 'test', errors: [{ messageId: 'literal-label' }] }, + { code: "{'< Back to blog'}", errors: [{ messageId: 'literal-label' }] }, + { code: '{`< Back to blog`}', errors: [{ messageId: 'literal-label' }] }, ], }); diff --git a/packages/material-ui-codemod/src/util/getJSExports.js b/packages/material-ui-codemod/src/util/getJSExports.js index 2f050f05174334..5ede8f49231f02 100644 --- a/packages/material-ui-codemod/src/util/getJSExports.js +++ b/packages/material-ui-codemod/src/util/getJSExports.js @@ -1,7 +1,7 @@ -import memoize from './memoize'; import { readFileSync } from 'fs'; import { parseSync } from '@babel/core'; import traverse from '@babel/traverse'; +import memoize from './memoize'; const getJSExports = memoize((file) => { const result = new Set(); diff --git a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.js b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.js index 5cdc1bf1a65ad3..59a92776b6e56b 100644 --- a/packages/material-ui-codemod/src/v4.0.0/optimal-imports.js +++ b/packages/material-ui-codemod/src/v4.0.0/optimal-imports.js @@ -1,6 +1,6 @@ import { dirname } from 'path'; -import getJSExports from '../util/getJSExports'; import addImports from 'jscodeshift-add-imports'; +import getJSExports from '../util/getJSExports'; // istanbul ignore next if (process.env.NODE_ENV === 'test') { diff --git a/packages/material-ui-lab/src/Alert/Alert.js b/packages/material-ui-lab/src/Alert/Alert.js index e7eaf1c048fe17..8681b08634b003 100644 --- a/packages/material-ui-lab/src/Alert/Alert.js +++ b/packages/material-ui-lab/src/Alert/Alert.js @@ -3,13 +3,13 @@ import PropTypes from 'prop-types'; import clsx from 'clsx'; import { withStyles, lighten, darken } from '@material-ui/core/styles'; import Paper from '@material-ui/core/Paper'; +import IconButton from '@material-ui/core/IconButton'; +import { capitalize } from '@material-ui/core/utils'; import SuccessOutlinedIcon from '../internal/svg-icons/SuccessOutlined'; import ReportProblemOutlinedIcon from '../internal/svg-icons/ReportProblemOutlined'; import ErrorOutlineIcon from '../internal/svg-icons/ErrorOutline'; import InfoOutlinedIcon from '../internal/svg-icons/InfoOutlined'; import CloseIcon from '../internal/svg-icons/Close'; -import IconButton from '@material-ui/core/IconButton'; -import { capitalize } from '@material-ui/core/utils'; export const styles = (theme) => { const getColor = theme.palette.type === 'light' ? darken : lighten; diff --git a/packages/material-ui-lab/src/Alert/Alert.test.js b/packages/material-ui-lab/src/Alert/Alert.test.js index c4de7927fd63bc..20f50ebc618414 100644 --- a/packages/material-ui-lab/src/Alert/Alert.test.js +++ b/packages/material-ui-lab/src/Alert/Alert.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; -import Alert from './Alert'; import Paper from '@material-ui/core/Paper'; +import Alert from './Alert'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts b/packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts index b9dc3e3b57a5dc..ceb8339cf886b4 100644 --- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts +++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.d.ts @@ -9,6 +9,7 @@ import { createFilterOptions, UseAutocompleteProps, } from '../useAutocomplete'; + export { AutocompleteChangeDetails, AutocompleteChangeReason, diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.js b/packages/material-ui-lab/src/Autocomplete/Autocomplete.js index 75787b43080430..7071a73d49aaf7 100644 --- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.js +++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.js @@ -241,7 +241,7 @@ function DisablePortal(props) { } const Autocomplete = React.forwardRef(function Autocomplete(props, ref) { - /* eslint-disable no-unused-vars */ + /* eslint-disable @typescript-eslint/no-unused-vars */ const { autoComplete = false, autoHighlight = false, @@ -305,7 +305,7 @@ const Autocomplete = React.forwardRef(function Autocomplete(props, ref) { value: valueProp, ...other } = props; - /* eslint-enable no-unused-vars */ + /* eslint-enable @typescript-eslint/no-unused-vars */ const PopperComponent = disablePortal ? DisablePortal : PopperComponentProp; diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.spec.tsx b/packages/material-ui-lab/src/Autocomplete/Autocomplete.spec.tsx index d6610afd7bd3bc..510b4dfdfc72c1 100644 --- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.spec.tsx +++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.spec.tsx @@ -1,3 +1,4 @@ +import * as React from 'react'; import { Autocomplete, AutocompleteProps } from '@material-ui/lab'; import { expectType } from '@material-ui/types'; diff --git a/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js b/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js index 4f7f6fcaf3945c..6c2bad8c97d73e 100644 --- a/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js +++ b/packages/material-ui-lab/src/Autocomplete/Autocomplete.test.js @@ -5,10 +5,10 @@ import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; import { spy } from 'sinon'; import { act, createClientRender, fireEvent, screen } from 'test/utils/createClientRender'; -import { createFilterOptions } from '../useAutocomplete/useAutocomplete'; -import Autocomplete from './Autocomplete'; import TextField from '@material-ui/core/TextField'; import Chip from '@material-ui/core/Chip'; +import { createFilterOptions } from '../useAutocomplete/useAutocomplete'; +import Autocomplete from './Autocomplete'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui-lab/src/AvatarGroup/AvatarGroup.test.js b/packages/material-ui-lab/src/AvatarGroup/AvatarGroup.test.js index 94ce0c4dc63796..9c33fc4f38e1c5 100644 --- a/packages/material-ui-lab/src/AvatarGroup/AvatarGroup.test.js +++ b/packages/material-ui-lab/src/AvatarGroup/AvatarGroup.test.js @@ -4,8 +4,8 @@ import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import Avatar from '@material-ui/core/Avatar'; import AvatarGroup from './AvatarGroup'; -import { Avatar } from '@material-ui/core'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui-lab/src/LoadingButton/LoadingButton.test.js b/packages/material-ui-lab/src/LoadingButton/LoadingButton.test.js index 9833dc0c7e6acb..6a03c8b88d9e02 100644 --- a/packages/material-ui-lab/src/LoadingButton/LoadingButton.test.js +++ b/packages/material-ui-lab/src/LoadingButton/LoadingButton.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; -import LoadingButton from './LoadingButton'; import Button from '@material-ui/core/Button'; +import LoadingButton from './LoadingButton'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui-lab/src/Pagination/Pagination.test.js b/packages/material-ui-lab/src/Pagination/Pagination.test.js index 4d182897a87763..76a1f61a98d98a 100644 --- a/packages/material-ui-lab/src/Pagination/Pagination.test.js +++ b/packages/material-ui-lab/src/Pagination/Pagination.test.js @@ -5,8 +5,8 @@ import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; -import Pagination from './Pagination'; import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles'; +import Pagination from './Pagination'; describe('', () => { let classes; diff --git a/packages/material-ui-lab/src/PaginationItem/PaginationItem.js b/packages/material-ui-lab/src/PaginationItem/PaginationItem.js index a47c2a5cbae4d1..710f51135d2696 100644 --- a/packages/material-ui-lab/src/PaginationItem/PaginationItem.js +++ b/packages/material-ui-lab/src/PaginationItem/PaginationItem.js @@ -3,11 +3,11 @@ import PropTypes from 'prop-types'; import clsx from 'clsx'; import { fade, useTheme, withStyles } from '@material-ui/core/styles'; import ButtonBase from '@material-ui/core/ButtonBase'; +import { capitalize } from '@material-ui/core/utils'; import FirstPageIcon from '../internal/svg-icons/FirstPage'; import LastPageIcon from '../internal/svg-icons/LastPage'; import NavigateBeforeIcon from '../internal/svg-icons/NavigateBefore'; import NavigateNextIcon from '../internal/svg-icons/NavigateNext'; -import { capitalize } from '@material-ui/core/utils'; export const styles = (theme) => ({ /* Styles applied to the root element. */ diff --git a/packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.test.js b/packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.test.js index e6b07d3f4d3c42..e25a2c73107f71 100644 --- a/packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.test.js +++ b/packages/material-ui-lab/src/SpeedDialAction/SpeedDialAction.test.js @@ -7,8 +7,8 @@ import { act, createClientRender, fireEvent } from 'test/utils/createClientRende import Icon from '@material-ui/core/Icon'; import Tooltip from '@material-ui/core/Tooltip'; import Fab from '@material-ui/core/Fab'; -import SpeedDialAction from './SpeedDialAction'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; +import SpeedDialAction from './SpeedDialAction'; describe('', () => { let clock; diff --git a/packages/material-ui-lab/src/SpeedDialIcon/SpeedDialIcon.test.js b/packages/material-ui-lab/src/SpeedDialIcon/SpeedDialIcon.test.js index 1284eaa284f0ca..94ef870eea6ea3 100644 --- a/packages/material-ui-lab/src/SpeedDialIcon/SpeedDialIcon.test.js +++ b/packages/material-ui-lab/src/SpeedDialIcon/SpeedDialIcon.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { getClasses, findOutermostIntrinsic } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import Icon from '@material-ui/core/Icon'; -import SpeedDialIcon from './SpeedDialIcon'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; +import SpeedDialIcon from './SpeedDialIcon'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui-lab/src/ToggleButton/ToggleButton.d.ts b/packages/material-ui-lab/src/ToggleButton/ToggleButton.d.ts index ba3f052a65ba9e..cc68b0a89cfbd2 100644 --- a/packages/material-ui-lab/src/ToggleButton/ToggleButton.d.ts +++ b/packages/material-ui-lab/src/ToggleButton/ToggleButton.d.ts @@ -1,8 +1,4 @@ -import { - ButtonBaseClassKey, - ExtendButtonBase, - ExtendButtonBaseTypeMap, -} from '@material-ui/core/ButtonBase'; +import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '@material-ui/core/ButtonBase'; import { OverrideProps } from '@material-ui/core/OverridableComponent'; export type ToggleButtonTypeMap< diff --git a/packages/material-ui-lab/src/ToggleButtonGroup/ToggleButtonGroup.js b/packages/material-ui-lab/src/ToggleButtonGroup/ToggleButtonGroup.js index 33e2e3adb52fd8..56cdb05069df49 100644 --- a/packages/material-ui-lab/src/ToggleButtonGroup/ToggleButtonGroup.js +++ b/packages/material-ui-lab/src/ToggleButtonGroup/ToggleButtonGroup.js @@ -2,9 +2,9 @@ import * as React from 'react'; import { isFragment } from 'react-is'; import PropTypes from 'prop-types'; import clsx from 'clsx'; -import isValueSelected from './isValueSelected'; import { withStyles } from '@material-ui/core/styles'; import { capitalize } from '@material-ui/core/utils'; +import isValueSelected from './isValueSelected'; export const styles = (theme) => ({ /* Styles applied to the root element. */ diff --git a/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.spec.ts b/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.spec.ts index 3608b57dea60c2..3650a117eb9e76 100644 --- a/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.spec.ts +++ b/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.spec.ts @@ -13,146 +13,146 @@ const persons: Person[] = [ { id: '4', name: 'Matt' }, ]; -// Single selection mode - -// value type is inferred correctly when multiple is undefined -useAutocomplete({ - options: ['1', '2', '3'], - onChange(event, value) { - expectType(value); - }, -}); - -// value type is inferred correctly when multiple is false -useAutocomplete({ - options: ['1', '2', '3'], - multiple: false, - onChange(event, value) { - expectType(value); - }, -}); - -// value type is inferred correctly for type unions -useAutocomplete({ - options: ['1', '2', '3', 4, true], - onChange(event, value) { - expectType(value); - }, -}); - -// value type is inferred correctly for interface -useAutocomplete({ - options: persons, - onChange(event, value) { - expectType(value); - }, -}); - -// value type is inferred correctly when value is set -useAutocomplete({ - options: ['1', '2', '3'], - onChange(event, value) { - expectType(value); - value; - }, - filterOptions(options, state) { - expectType, typeof state>(state); - expectType(options); - return options; - }, - getOptionLabel(option) { - expectType(option); - return option; - }, - value: null, -}); - -// Multiple selection mode - -// value type is inferred correctly for simple type -useAutocomplete({ - options: ['1', '2', '3'], - multiple: true, - onChange(event, value) { - expectType(value); - value; - }, -}); - -// value type is inferred correctly for union type -useAutocomplete({ - options: ['1', '2', '3', 4, true], - multiple: true, - onChange(event, value) { - expectType, typeof value>(value); - }, -}); - -// value type is inferred correctly for interface -useAutocomplete({ - options: persons, - multiple: true, - onChange(event, value) { - expectType(value); - value; - }, -}); - -// no type inference conflict when value type is set explicitly -useAutocomplete({ - options: persons, - multiple: true, - onChange(event, value: Person[]) {}, -}); - -// Disable clearable - -useAutocomplete({ - options: ['1', '2', '3'], - disableClearable: true, - onChange(event, value) { - expectType(value); - }, -}); - -useAutocomplete({ - options: ['1', '2', '3'], - disableClearable: false, - onChange(event, value) { - expectType(value); - }, -}); - -useAutocomplete({ - options: ['1', '2', '3'], - onChange(event, value) { - expectType(value); - }, -}); - -// Free solo -useAutocomplete({ - options: persons, - onChange(event, value) { - expectType(value); - }, - freeSolo: true, -}); - -useAutocomplete({ - options: persons, - disableClearable: true, - onChange(event, value) { - expectType(value); - }, - freeSolo: true, -}); - -useAutocomplete({ - options: persons, - multiple: true, - onChange(event, value) { - expectType, typeof value>(value); - }, - freeSolo: true, -}); +function Component() { + // value type is inferred correctly when multiple is undefined + useAutocomplete({ + options: ['1', '2', '3'], + onChange(event, value) { + expectType(value); + }, + }); + + // value type is inferred correctly when multiple is false + useAutocomplete({ + options: ['1', '2', '3'], + multiple: false, + onChange(event, value) { + expectType(value); + }, + }); + + // value type is inferred correctly for type unions + useAutocomplete({ + options: ['1', '2', '3', 4, true], + onChange(event, value) { + expectType(value); + }, + }); + + // value type is inferred correctly for interface + useAutocomplete({ + options: persons, + onChange(event, value) { + expectType(value); + }, + }); + + // value type is inferred correctly when value is set + useAutocomplete({ + options: ['1', '2', '3'], + onChange(event, value) { + expectType(value); + value; + }, + filterOptions(options, state) { + expectType, typeof state>(state); + expectType(options); + return options; + }, + getOptionLabel(option) { + expectType(option); + return option; + }, + value: null, + }); + + // Multiple selection mode + + // value type is inferred correctly for simple type + useAutocomplete({ + options: ['1', '2', '3'], + multiple: true, + onChange(event, value) { + expectType(value); + value; + }, + }); + + // value type is inferred correctly for union type + useAutocomplete({ + options: ['1', '2', '3', 4, true], + multiple: true, + onChange(event, value) { + expectType, typeof value>(value); + }, + }); + + // value type is inferred correctly for interface + useAutocomplete({ + options: persons, + multiple: true, + onChange(event, value) { + expectType(value); + value; + }, + }); + + // no type inference conflict when value type is set explicitly + useAutocomplete({ + options: persons, + multiple: true, + onChange(event, value: Person[]) {}, + }); + + // Disable clearable + + useAutocomplete({ + options: ['1', '2', '3'], + disableClearable: true, + onChange(event, value) { + expectType(value); + }, + }); + + useAutocomplete({ + options: ['1', '2', '3'], + disableClearable: false, + onChange(event, value) { + expectType(value); + }, + }); + + useAutocomplete({ + options: ['1', '2', '3'], + onChange(event, value) { + expectType(value); + }, + }); + + // Free solo + useAutocomplete({ + options: persons, + onChange(event, value) { + expectType(value); + }, + freeSolo: true, + }); + + useAutocomplete({ + options: persons, + disableClearable: true, + onChange(event, value) { + expectType(value); + }, + freeSolo: true, + }); + + useAutocomplete({ + options: persons, + multiple: true, + onChange(event, value) { + expectType, typeof value>(value); + }, + freeSolo: true, + }); +} diff --git a/packages/material-ui-styles/src/StylesProvider/StylesProvider.js b/packages/material-ui-styles/src/StylesProvider/StylesProvider.js index 2ea7e6c76c0afa..3ec3a425f98750 100644 --- a/packages/material-ui-styles/src/StylesProvider/StylesProvider.js +++ b/packages/material-ui-styles/src/StylesProvider/StylesProvider.js @@ -1,8 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import { exactProp } from '@material-ui/utils'; -import createGenerateClassName from '../createGenerateClassName'; import { create } from 'jss'; +import createGenerateClassName from '../createGenerateClassName'; import jssPreset from '../jssPreset'; // Default JSS instance. diff --git a/packages/material-ui-styles/src/defaultTheme/defaultTheme.spec.ts b/packages/material-ui-styles/src/defaultTheme/defaultTheme.spec.ts index adcb41a92d255c..9a6368de187328 100644 --- a/packages/material-ui-styles/src/defaultTheme/defaultTheme.spec.ts +++ b/packages/material-ui-styles/src/defaultTheme/defaultTheme.spec.ts @@ -8,7 +8,7 @@ declare module '@material-ui/styles' { } } -{ +function MyComponent() { const value = useTheme().myProperty; expectType(value); } diff --git a/packages/material-ui-styles/src/makeStyles/makeStyles.d.ts b/packages/material-ui-styles/src/makeStyles/makeStyles.d.ts index f1ffc3d4b23055..a0ce04b43fcde1 100644 --- a/packages/material-ui-styles/src/makeStyles/makeStyles.d.ts +++ b/packages/material-ui-styles/src/makeStyles/makeStyles.d.ts @@ -1,9 +1,4 @@ -import { - ClassNameMap, - PropsOfStyles, - Styles, - WithStylesOptions, -} from '@material-ui/styles/withStyles'; +import { ClassNameMap, Styles, WithStylesOptions } from '@material-ui/styles/withStyles'; import { Omit } from '@material-ui/types'; import { DefaultTheme } from '../defaultTheme'; @@ -14,6 +9,7 @@ export default function makeStyles, options?: Omit, 'withTheme'> ): (props?: any) => ClassNameMap; + /** * `makeStyles` where the passed `styles` do depend on props */ diff --git a/packages/material-ui-styles/src/makeStyles/makeStyles.spec.tsx b/packages/material-ui-styles/src/makeStyles/makeStyles.spec.tsx index 3e254c40713795..0f5a50ca7b0b74 100644 --- a/packages/material-ui-styles/src/makeStyles/makeStyles.spec.tsx +++ b/packages/material-ui-styles/src/makeStyles/makeStyles.spec.tsx @@ -119,19 +119,19 @@ import { createStyles, makeStyles } from '@material-ui/styles'; color: theme.palette.primary.main, }), })); +} - { - // If any generic is provided, inferrence breaks. - // If the proposal https://github.com/Microsoft/TypeScript/issues/26242 goes through, we can fix this. - const useStyles = makeStyles((theme) => ({ - root: { - background: 'blue', - }, - })); +function MyComponent() { + // If any generic is provided, inferrence breaks. + // If the proposal https://github.com/Microsoft/TypeScript/issues/26242 goes through, we can fix this. + const useStyles = makeStyles((theme) => ({ + root: { + background: 'blue', + }, + })); - const classes = useStyles(); + const classes = useStyles(); - // This doesn't fail, because inferrence is broken - classes.other; - } + // This doesn't fail, because inferrence is broken + classes.other; } diff --git a/packages/material-ui-styles/src/styled/styled.spec.tsx b/packages/material-ui-styles/src/styled/styled.spec.tsx index 4ee389dece1cd7..135cda0ec689b3 100644 --- a/packages/material-ui-styles/src/styled/styled.spec.tsx +++ b/packages/material-ui-styles/src/styled/styled.spec.tsx @@ -75,6 +75,7 @@ function acceptanceTest() { static defaultProps = { defaulted: 'Hello, World!', }; + render() { const { className, defaulted } = this.props; return Greeted?: {defaulted.startsWith('Hello')}; diff --git a/packages/material-ui-styles/src/styled/styled.test.js b/packages/material-ui-styles/src/styled/styled.test.js index 18c244abe7bd35..a87919b9b40879 100644 --- a/packages/material-ui-styles/src/styled/styled.test.js +++ b/packages/material-ui-styles/src/styled/styled.test.js @@ -1,10 +1,10 @@ import React from 'react'; import { expect } from 'chai'; import PropTypes from 'prop-types'; -import styled from './styled'; import { SheetsRegistry } from 'jss'; import createMount from 'test/utils/createMount'; import { createGenerateClassName } from '@material-ui/styles'; +import styled from './styled'; import StylesProvider from '../StylesProvider'; describe('styled', () => { diff --git a/packages/material-ui-styles/test/styles.spec.tsx b/packages/material-ui-styles/test/styles.spec.tsx index 49fc999245cc7c..3b1bf2b5d7446a 100644 --- a/packages/material-ui-styles/test/styles.spec.tsx +++ b/packages/material-ui-styles/test/styles.spec.tsx @@ -402,7 +402,7 @@ withStyles((theme) => } } -function forwardRefTest() { +function ForwardRefTest() { const styles = createStyles({ root: { color: 'red' }, }); @@ -439,19 +439,20 @@ function forwardRefTest() { { // https://github.com/mui-org/material-ui/pull/15546 // Update type definition to let CSS properties be functions - interface testProps { + interface TestProps { foo: boolean; } const useStyles = makeStyles((theme: Theme) => ({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), height: 100, }), })); + // eslint-disable-next-line react-hooks/rules-of-hooks const styles = useStyles({ foo: true }); expectType, typeof styles>(styles); } @@ -480,12 +481,12 @@ function forwardRefTest() { typeof styles2 >(styles2); - interface testProps { + interface TestProps { foo: boolean; } const styles3 = createStyles({ - root: (props: testProps) => ({ + root: (props: TestProps) => ({ width: 1, }), }); @@ -493,8 +494,8 @@ function forwardRefTest() { Record< 'root', | CSSProperties - | CreateCSSProperties - | PropsFunc> + | CreateCSSProperties + | PropsFunc> >, typeof styles3 >(styles3); diff --git a/packages/material-ui-system/src/index.spec.tsx b/packages/material-ui-system/src/index.spec.tsx index 4c68b1dafe58fe..e6b97c41ecf2b2 100644 --- a/packages/material-ui-system/src/index.spec.tsx +++ b/packages/material-ui-system/src/index.spec.tsx @@ -1,12 +1,4 @@ -import { - compose, - css, - palette, - StyleFunction, - spacing, - style, - breakpoints, -} from '@material-ui/system'; +import { compose, css, palette, spacing, style, breakpoints } from '@material-ui/system'; import * as React from 'react'; import styled from 'styled-components'; diff --git a/packages/material-ui-utils/src/deepmerge.test.js b/packages/material-ui-utils/src/deepmerge.test.js index 4c5b68e1a5aa4c..4fa400bc6b5707 100644 --- a/packages/material-ui-utils/src/deepmerge.test.js +++ b/packages/material-ui-utils/src/deepmerge.test.js @@ -1,5 +1,5 @@ -import deepmerge from './deepmerge'; import { expect } from 'chai'; +import deepmerge from './deepmerge'; describe('deepmerge', () => { // https://snyk.io/blog/after-three-years-of-silence-a-new-jquery-prototype-pollution-vulnerability-emerges-once-again/ diff --git a/packages/material-ui/src/AccordionSummary/AccordionSummary.test.js b/packages/material-ui/src/AccordionSummary/AccordionSummary.test.js index 19e9ea13740f21..d0922b057a0711 100644 --- a/packages/material-ui/src/AccordionSummary/AccordionSummary.test.js +++ b/packages/material-ui/src/AccordionSummary/AccordionSummary.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Accordion from '../Accordion'; import AccordionSummary from './AccordionSummary'; import ButtonBase from '../ButtonBase'; diff --git a/packages/material-ui/src/BottomNavigationAction/BottomNavigationAction.test.js b/packages/material-ui/src/BottomNavigationAction/BottomNavigationAction.test.js index a20e733af4d6f2..a1284b2892fb83 100644 --- a/packages/material-ui/src/BottomNavigationAction/BottomNavigationAction.test.js +++ b/packages/material-ui/src/BottomNavigationAction/BottomNavigationAction.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender, within } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import ButtonBase from '../ButtonBase'; import BottomNavigationAction from './BottomNavigationAction'; diff --git a/packages/material-ui/src/Breadcrumbs/BreadcrumbCollapsed.test.js b/packages/material-ui/src/Breadcrumbs/BreadcrumbCollapsed.test.js index 75fe08132c1b74..b24c16550da0bc 100644 --- a/packages/material-ui/src/Breadcrumbs/BreadcrumbCollapsed.test.js +++ b/packages/material-ui/src/Breadcrumbs/BreadcrumbCollapsed.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; -import BreadcrumbCollapsed from './BreadcrumbCollapsed'; import { act, fireEvent, createClientRender } from 'test/utils/createClientRender'; +import BreadcrumbCollapsed from './BreadcrumbCollapsed'; describe('', () => { let classes; diff --git a/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js b/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js index 3e07bd4e15479d..20b614959d27de 100644 --- a/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js +++ b/packages/material-ui/src/Breadcrumbs/Breadcrumbs.test.js @@ -2,9 +2,9 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; +import { act, createClientRender, screen } from 'test/utils/createClientRender'; import describeConformance from '../test-utils/describeConformance'; import Breadcrumbs from './Breadcrumbs'; -import { act, createClientRender, screen } from 'test/utils/createClientRender'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui/src/Button/Button.d.ts b/packages/material-ui/src/Button/Button.d.ts index 6964b39237f9cb..7287d5bc4242a5 100644 --- a/packages/material-ui/src/Button/Button.d.ts +++ b/packages/material-ui/src/Button/Button.d.ts @@ -1,4 +1,3 @@ -import { PropTypes } from '..'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent'; diff --git a/packages/material-ui/src/Button/Button.spec.tsx b/packages/material-ui/src/Button/Button.spec.tsx index 08e454105327ae..84a04b94849dcb 100644 --- a/packages/material-ui/src/Button/Button.spec.tsx +++ b/packages/material-ui/src/Button/Button.spec.tsx @@ -35,7 +35,7 @@ const ButtonTest = () => ( Link Link - // By default the underlying component is a button element: + {/* By default the underlying component is a button element */} { expectType(elem); @@ -47,7 +47,7 @@ const ButtonTest = () => ( > Button - // If an href is provided, an anchor is used: + {/* If an href is provided, an anchor is used */} { @@ -60,7 +60,7 @@ const ButtonTest = () => ( > Link - // If a component prop is specified, use that: + {/* If a component prop is specified, use that: */} component="div" ref={(elem) => { diff --git a/packages/material-ui/src/Button/Button.test.js b/packages/material-ui/src/Button/Button.test.js index ac5065049e256e..542a63a55fe7d8 100644 --- a/packages/material-ui/src/Button/Button.test.js +++ b/packages/material-ui/src/Button/Button.test.js @@ -2,10 +2,10 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; import createServerRender from 'test/utils/createServerRender'; import Button from './Button'; +import describeConformance from '../test-utils/describeConformance'; import ButtonBase from '../ButtonBase'; describe('', () => { diff --git a/packages/material-ui/src/ButtonBase/ButtonBase.test.js b/packages/material-ui/src/ButtonBase/ButtonBase.test.js index 9ff6734bc7f79e..72b1f87bb8ff23 100644 --- a/packages/material-ui/src/ButtonBase/ButtonBase.test.js +++ b/packages/material-ui/src/ButtonBase/ButtonBase.test.js @@ -4,11 +4,11 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; +import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import * as PropTypes from 'prop-types'; import describeConformance from '../test-utils/describeConformance'; import TouchRipple from './TouchRipple'; import ButtonBase from './ButtonBase'; -import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; -import * as PropTypes from 'prop-types'; /** * @param {HTMLElement} element diff --git a/packages/material-ui/src/ButtonGroup/ButtonGroup.d.ts b/packages/material-ui/src/ButtonGroup/ButtonGroup.d.ts index 1d6d4d82391508..e8ea8b541ae70b 100644 --- a/packages/material-ui/src/ButtonGroup/ButtonGroup.d.ts +++ b/packages/material-ui/src/ButtonGroup/ButtonGroup.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { PropTypes } from '..'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; export interface ButtonGroupTypeMap { diff --git a/packages/material-ui/src/ButtonGroup/ButtonGroup.js b/packages/material-ui/src/ButtonGroup/ButtonGroup.js index f405cc87f74250..efbbfc01aee62a 100644 --- a/packages/material-ui/src/ButtonGroup/ButtonGroup.js +++ b/packages/material-ui/src/ButtonGroup/ButtonGroup.js @@ -8,7 +8,7 @@ import withStyles from '../styles/withStyles'; import Button from '../Button'; // Force a side effect so we don't have any override priority issue. -// eslint-disable-next-line no-unused-expressions +// eslint-disable-next-line @typescript-eslint/no-unused-expressions Button.styles; export const styles = (theme) => ({ diff --git a/packages/material-ui/src/Card/Card.d.ts b/packages/material-ui/src/Card/Card.d.ts index 684339eab7cda0..03d0a3d638c4c9 100644 --- a/packages/material-ui/src/Card/Card.d.ts +++ b/packages/material-ui/src/Card/Card.d.ts @@ -1,4 +1,3 @@ -import * as React from 'react'; import { StandardProps } from '..'; import { PaperProps } from '../Paper'; diff --git a/packages/material-ui/src/CardMedia/CardMedia.js b/packages/material-ui/src/CardMedia/CardMedia.js index 4670849bd47c06..60699a405001fc 100644 --- a/packages/material-ui/src/CardMedia/CardMedia.js +++ b/packages/material-ui/src/CardMedia/CardMedia.js @@ -1,8 +1,8 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; -import withStyles from '../styles/withStyles'; import { chainPropTypes } from '@material-ui/utils'; +import withStyles from '../styles/withStyles'; export const styles = { /* Styles applied to the root element. */ diff --git a/packages/material-ui/src/CardMedia/CardMedia.test.js b/packages/material-ui/src/CardMedia/CardMedia.test.js index 8296bc64cf2cc3..1d657a5ed7afea 100644 --- a/packages/material-ui/src/CardMedia/CardMedia.test.js +++ b/packages/material-ui/src/CardMedia/CardMedia.test.js @@ -1,11 +1,11 @@ import * as React from 'react'; +import PropTypes from 'prop-types'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import { createClientRender } from 'test/utils/createClientRender'; import describeConformance from '../test-utils/describeConformance'; import CardMedia from './CardMedia'; -import PropTypes from 'prop-types'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui/src/Checkbox/Checkbox.test.js b/packages/material-ui/src/Checkbox/Checkbox.test.js index bb04361debd3a7..a5f8d4f6df6d62 100644 --- a/packages/material-ui/src/Checkbox/Checkbox.test.js +++ b/packages/material-ui/src/Checkbox/Checkbox.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Checkbox from './Checkbox'; import FormControl from '../FormControl'; import IconButton from '../IconButton'; diff --git a/packages/material-ui/src/Chip/Chip.test.js b/packages/material-ui/src/Chip/Chip.test.js index 5ddccd80843872..7d533447e997e0 100644 --- a/packages/material-ui/src/Chip/Chip.test.js +++ b/packages/material-ui/src/Chip/Chip.test.js @@ -1,11 +1,11 @@ import * as React from 'react'; import { expect } from 'chai'; import { spy, stub } from 'sinon'; -import CheckBox from '../internal/svg-icons/CheckBox'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import CheckBox from '../internal/svg-icons/CheckBox'; +import describeConformance from '../test-utils/describeConformance'; import Avatar from '../Avatar'; import Chip from './Chip'; diff --git a/packages/material-ui/src/ClickAwayListener/ClickAwayListener.js b/packages/material-ui/src/ClickAwayListener/ClickAwayListener.js index d4039a3ab23833..cf5999ea564c7c 100644 --- a/packages/material-ui/src/ClickAwayListener/ClickAwayListener.js +++ b/packages/material-ui/src/ClickAwayListener/ClickAwayListener.js @@ -1,10 +1,10 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; +import { elementAcceptingRef, exactProp } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import useForkRef from '../utils/useForkRef'; import useEventCallback from '../utils/useEventCallback'; -import { elementAcceptingRef, exactProp } from '@material-ui/utils'; function mapEventPropToEvent(eventProp) { return eventProp.substring(2).toLowerCase(); diff --git a/packages/material-ui/src/Collapse/Collapse.d.ts b/packages/material-ui/src/Collapse/Collapse.d.ts index d3f4cccab1cfe3..78cc242030306c 100644 --- a/packages/material-ui/src/Collapse/Collapse.d.ts +++ b/packages/material-ui/src/Collapse/Collapse.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { StandardProps } from '..'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface CollapseProps extends StandardProps { diff --git a/packages/material-ui/src/Collapse/Collapse.test.js b/packages/material-ui/src/Collapse/Collapse.test.js index e953374fd58749..adc91fe3e4f24d 100644 --- a/packages/material-ui/src/Collapse/Collapse.test.js +++ b/packages/material-ui/src/Collapse/Collapse.test.js @@ -4,14 +4,14 @@ import { spy, stub, useFakeTimers } from 'sinon'; import { createClientRender } from 'test/utils/createClientRender'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; -import Collapse from './Collapse'; import { ThemeProvider, createMuiTheme, unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, } from '@material-ui/core/styles'; import { Transition } from 'react-transition-group'; +import describeConformance from '../test-utils/describeConformance'; +import Collapse from './Collapse'; describe('', () => { // StrictModeViolation: uses react-transition-group diff --git a/packages/material-ui/src/CssBaseline/CssBaseline.js b/packages/material-ui/src/CssBaseline/CssBaseline.js index d62176ddcde7db..7acda742d66f86 100644 --- a/packages/material-ui/src/CssBaseline/CssBaseline.js +++ b/packages/material-ui/src/CssBaseline/CssBaseline.js @@ -1,7 +1,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import withStyles from '../styles/withStyles'; import { exactProp } from '@material-ui/utils'; +import withStyles from '../styles/withStyles'; export const html = { WebkitFontSmoothing: 'antialiased', // Antialiasing. @@ -46,9 +46,8 @@ export const styles = (theme) => ({ * Kickstart an elegant, consistent, and simple baseline to build upon. */ function CssBaseline(props) { - /* eslint-disable no-unused-vars */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { children = null, classes } = props; - /* eslint-enable no-unused-vars */ return {children}; } diff --git a/packages/material-ui/src/Dialog/Dialog.test.js b/packages/material-ui/src/Dialog/Dialog.test.js index 6ebcbe85b3389e..329bad6efecd45 100644 --- a/packages/material-ui/src/Dialog/Dialog.test.js +++ b/packages/material-ui/src/Dialog/Dialog.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Modal from '../Modal'; import Dialog from './Dialog'; diff --git a/packages/material-ui/src/Drawer/Drawer.d.ts b/packages/material-ui/src/Drawer/Drawer.d.ts index e647049b5f42a4..7782dab4a69a25 100644 --- a/packages/material-ui/src/Drawer/Drawer.d.ts +++ b/packages/material-ui/src/Drawer/Drawer.d.ts @@ -3,7 +3,6 @@ import { StandardProps } from '..'; import { ModalProps } from '../Modal'; import { SlideProps } from '../Slide'; import { PaperProps } from '../Paper'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionHandlerProps, TransitionProps } from '../transitions/transition'; export interface DrawerProps diff --git a/packages/material-ui/src/Drawer/Drawer.test.js b/packages/material-ui/src/Drawer/Drawer.test.js index 4d841c28a0a417..c61b36716b7677 100644 --- a/packages/material-ui/src/Drawer/Drawer.test.js +++ b/packages/material-ui/src/Drawer/Drawer.test.js @@ -3,12 +3,12 @@ import { expect } from 'chai'; import { findOutermostIntrinsic, getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import { ThemeProvider, createMuiTheme } from '@material-ui/core/styles'; +import { createClientRender } from 'test/utils/createClientRender'; import describeConformance from '../test-utils/describeConformance'; import Slide from '../Slide'; import Paper from '../Paper'; import Modal from '../Modal'; import Drawer, { getAnchor, isHorizontal } from './Drawer'; -import { createClientRender } from 'test/utils/createClientRender'; describe('', () => { // StrictModeViolation: uses Slide diff --git a/packages/material-ui/src/Fade/Fade.test.js b/packages/material-ui/src/Fade/Fade.test.js index 5988c01903cdb9..6e0f7c83006ce0 100644 --- a/packages/material-ui/src/Fade/Fade.test.js +++ b/packages/material-ui/src/Fade/Fade.test.js @@ -7,8 +7,8 @@ import { } from '@material-ui/core/styles'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; -import Fade from './Fade'; import { Transition } from 'react-transition-group'; +import Fade from './Fade'; describe('', () => { // StrictModeViolation: uses react-transition-group diff --git a/packages/material-ui/src/FilledInput/FilledInput.test.js b/packages/material-ui/src/FilledInput/FilledInput.test.js index 00961ea39c5a0e..5d25fcf85c4c2e 100644 --- a/packages/material-ui/src/FilledInput/FilledInput.test.js +++ b/packages/material-ui/src/FilledInput/FilledInput.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FilledInput from './FilledInput'; import InputBase from '../InputBase'; diff --git a/packages/material-ui/src/FormControl/FormControl.js b/packages/material-ui/src/FormControl/FormControl.js index c327fe1b771ecf..638473c130ca92 100644 --- a/packages/material-ui/src/FormControl/FormControl.js +++ b/packages/material-ui/src/FormControl/FormControl.js @@ -119,8 +119,8 @@ const FormControl = React.forwardRef(function FormControl(props, ref) { return initialFilled; }); - const [_focused, setFocused] = React.useState(false); - const focused = visuallyFocused !== undefined ? visuallyFocused : _focused; + const [focusedState, setFocused] = React.useState(false); + const focused = visuallyFocused !== undefined ? visuallyFocused : focusedState; if (disabled && focused) { setFocused(false); diff --git a/packages/material-ui/src/FormControl/FormControl.test.js b/packages/material-ui/src/FormControl/FormControl.test.js index 9babe2411e70f7..d938cf14729790 100644 --- a/packages/material-ui/src/FormControl/FormControl.test.js +++ b/packages/material-ui/src/FormControl/FormControl.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Input from '../Input'; import Select from '../Select'; import FormControl from './FormControl'; diff --git a/packages/material-ui/src/FormControl/useFormControl.d.ts b/packages/material-ui/src/FormControl/useFormControl.d.ts index ab0e95221880f3..17b7806ebd0191 100644 --- a/packages/material-ui/src/FormControl/useFormControl.d.ts +++ b/packages/material-ui/src/FormControl/useFormControl.d.ts @@ -1,4 +1,3 @@ -import { Context } from 'react'; import { FormControlProps } from './FormControl'; // shut off automatic exporting diff --git a/packages/material-ui/src/FormControlLabel/FormControlLabel.test.js b/packages/material-ui/src/FormControlLabel/FormControlLabel.test.js index 5b1e7a5dda48d7..add81bfd6d2b17 100644 --- a/packages/material-ui/src/FormControlLabel/FormControlLabel.test.js +++ b/packages/material-ui/src/FormControlLabel/FormControlLabel.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Checkbox from '../Checkbox'; import FormControlLabel from './FormControlLabel'; import FormControl from '../FormControl'; diff --git a/packages/material-ui/src/FormHelperText/FormHelperText.test.js b/packages/material-ui/src/FormHelperText/FormHelperText.test.js index 502ba28c2d7fba..78db2d23675acf 100644 --- a/packages/material-ui/src/FormHelperText/FormHelperText.test.js +++ b/packages/material-ui/src/FormHelperText/FormHelperText.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormHelperText from './FormHelperText'; import FormControl from '../FormControl'; diff --git a/packages/material-ui/src/FormLabel/FormLabel.test.js b/packages/material-ui/src/FormLabel/FormLabel.test.js index 427c964ed25df0..a3b9396bfd9fc4 100644 --- a/packages/material-ui/src/FormLabel/FormLabel.test.js +++ b/packages/material-ui/src/FormLabel/FormLabel.test.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormLabel from './FormLabel'; import FormControl, { useFormControl } from '../FormControl'; diff --git a/packages/material-ui/src/GridListTile/GridListTile.js b/packages/material-ui/src/GridListTile/GridListTile.js index 68f7e24990c957..d08d9e4ff5a1ec 100644 --- a/packages/material-ui/src/GridListTile/GridListTile.js +++ b/packages/material-ui/src/GridListTile/GridListTile.js @@ -57,10 +57,10 @@ const GridListTile = React.forwardRef(function GridListTile(props, ref) { children, classes, className, - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars cols = 1, component: Component = 'li', - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars rows = 1, ...other } = props; diff --git a/packages/material-ui/src/Grow/Grow.d.ts b/packages/material-ui/src/Grow/Grow.d.ts index 2f18a9fe238fb6..5060672218f34e 100644 --- a/packages/material-ui/src/Grow/Grow.d.ts +++ b/packages/material-ui/src/Grow/Grow.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { Omit } from '@material-ui/types'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface GrowProps extends Omit { diff --git a/packages/material-ui/src/Grow/Grow.test.js b/packages/material-ui/src/Grow/Grow.test.js index d023797c7ca5ff..4d2266a8aed0f5 100644 --- a/packages/material-ui/src/Grow/Grow.test.js +++ b/packages/material-ui/src/Grow/Grow.test.js @@ -3,13 +3,13 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; -import Grow from './Grow'; import { createMuiTheme, ThemeProvider, unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, } from '@material-ui/core/styles'; import { Transition } from 'react-transition-group'; +import Grow from './Grow'; import useForkRef from '../utils/useForkRef'; describe('', () => { diff --git a/packages/material-ui/src/IconButton/IconButton.test.js b/packages/material-ui/src/IconButton/IconButton.test.js index f03f00e1c2d449..c33f6656806cb6 100644 --- a/packages/material-ui/src/IconButton/IconButton.test.js +++ b/packages/material-ui/src/IconButton/IconButton.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import PropTypes from 'prop-types'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Icon from '../Icon'; import ButtonBase from '../ButtonBase'; import IconButton from './IconButton'; diff --git a/packages/material-ui/src/Input/Input.d.ts b/packages/material-ui/src/Input/Input.d.ts index ef2269ce42a5ee..21dae1565a3f9d 100644 --- a/packages/material-ui/src/Input/Input.d.ts +++ b/packages/material-ui/src/Input/Input.d.ts @@ -1,4 +1,3 @@ -import * as React from 'react'; import { StandardProps } from '..'; import { InputBaseProps } from '../InputBase'; diff --git a/packages/material-ui/src/InputAdornment/InputAdornment.test.js b/packages/material-ui/src/InputAdornment/InputAdornment.test.js index 9a6ac9ea565313..f905346dedf9c4 100644 --- a/packages/material-ui/src/InputAdornment/InputAdornment.test.js +++ b/packages/material-ui/src/InputAdornment/InputAdornment.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Typography from '../Typography'; import InputAdornment from './InputAdornment'; import TextField from '../TextField'; diff --git a/packages/material-ui/src/InputBase/InputBase.test.js b/packages/material-ui/src/InputBase/InputBase.test.js index 36ab7a09f9aab9..0e214cddbdb476 100644 --- a/packages/material-ui/src/InputBase/InputBase.test.js +++ b/packages/material-ui/src/InputBase/InputBase.test.js @@ -4,8 +4,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl, { useFormControl } from '../FormControl'; import InputAdornment from '../InputAdornment'; import TextareaAutosize from '../TextareaAutosize'; diff --git a/packages/material-ui/src/InputLabel/InputLabel.test.js b/packages/material-ui/src/InputLabel/InputLabel.test.js index 168001d1aeb64f..33d77d6efa35ab 100644 --- a/packages/material-ui/src/InputLabel/InputLabel.test.js +++ b/packages/material-ui/src/InputLabel/InputLabel.test.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl from '../FormControl'; import Input from '../Input'; import InputLabel from './InputLabel'; diff --git a/packages/material-ui/src/Link/Link.d.ts b/packages/material-ui/src/Link/Link.d.ts index 2800915e13019a..bf4512947a0a2e 100644 --- a/packages/material-ui/src/Link/Link.d.ts +++ b/packages/material-ui/src/Link/Link.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { Omit } from '@material-ui/types'; +import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TypographyProps } from '../Typography'; export interface LinkTypeMap { diff --git a/packages/material-ui/src/Link/Link.js b/packages/material-ui/src/Link/Link.js index b095602655175b..9dc14fc342768e 100644 --- a/packages/material-ui/src/Link/Link.js +++ b/packages/material-ui/src/Link/Link.js @@ -1,9 +1,9 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; +import { elementTypeAcceptingRef } from '@material-ui/utils'; import capitalize from '../utils/capitalize'; import withStyles from '../styles/withStyles'; -import { elementTypeAcceptingRef } from '@material-ui/utils'; import useIsFocusVisible from '../utils/useIsFocusVisible'; import useForkRef from '../utils/useForkRef'; import Typography from '../Typography'; diff --git a/packages/material-ui/src/ListItem/ListItem.js b/packages/material-ui/src/ListItem/ListItem.js index 39d1e2c72aae1e..1f319c543c77b3 100644 --- a/packages/material-ui/src/ListItem/ListItem.js +++ b/packages/material-ui/src/ListItem/ListItem.js @@ -1,4 +1,5 @@ import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { chainPropTypes } from '@material-ui/utils'; @@ -7,7 +8,6 @@ import ButtonBase from '../ButtonBase'; import isMuiElement from '../utils/isMuiElement'; import useForkRef from '../utils/useForkRef'; import ListContext from '../List/ListContext'; -import * as ReactDOM from 'react-dom'; export const styles = (theme) => ({ /* Styles applied to the (normally root) `component` element. May be wrapped by a `container`. */ diff --git a/packages/material-ui/src/ListItem/ListItem.test.js b/packages/material-ui/src/ListItem/ListItem.test.js index 25de891e7ddcfb..f3be77faf3c064 100644 --- a/packages/material-ui/src/ListItem/ListItem.test.js +++ b/packages/material-ui/src/ListItem/ListItem.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import PropTypes from 'prop-types'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent, queries, screen } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import ListItemText from '../ListItemText'; import ListItemSecondaryAction from '../ListItemSecondaryAction'; import ListItem from './ListItem'; diff --git a/packages/material-ui/src/ListSubheader/ListSubheader.d.ts b/packages/material-ui/src/ListSubheader/ListSubheader.d.ts index a896fbcdfc11fb..126855bd0653bf 100644 --- a/packages/material-ui/src/ListSubheader/ListSubheader.d.ts +++ b/packages/material-ui/src/ListSubheader/ListSubheader.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { StandardProps } from '..'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; export interface ListSubheaderTypeMap { diff --git a/packages/material-ui/src/Menu/Menu.d.ts b/packages/material-ui/src/Menu/Menu.d.ts index e84e379ee45130..df62c39be1c159 100644 --- a/packages/material-ui/src/Menu/Menu.d.ts +++ b/packages/material-ui/src/Menu/Menu.d.ts @@ -1,7 +1,6 @@ import * as React from 'react'; import { PopoverProps } from '../Popover'; import { MenuListProps } from '../MenuList'; -import { PaperProps } from '../Paper'; import { StandardProps } from '..'; import { TransitionHandlerProps, TransitionProps } from '../transitions/transition'; diff --git a/packages/material-ui/src/Menu/Menu.js b/packages/material-ui/src/Menu/Menu.js index deae57fb09f20d..08abb78b8db7a1 100644 --- a/packages/material-ui/src/Menu/Menu.js +++ b/packages/material-ui/src/Menu/Menu.js @@ -1,4 +1,5 @@ import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import { isFragment } from 'react-is'; import PropTypes from 'prop-types'; import clsx from 'clsx'; @@ -6,7 +7,6 @@ import { HTMLElementType } from '@material-ui/utils'; import withStyles from '../styles/withStyles'; import Popover from '../Popover'; import MenuList from '../MenuList'; -import * as ReactDOM from 'react-dom'; import setRef from '../utils/setRef'; import useTheme from '../styles/useTheme'; diff --git a/packages/material-ui/src/MenuItem/MenuItem.d.ts b/packages/material-ui/src/MenuItem/MenuItem.d.ts index ab44e0f48d820b..750d2f3263c725 100644 --- a/packages/material-ui/src/MenuItem/MenuItem.d.ts +++ b/packages/material-ui/src/MenuItem/MenuItem.d.ts @@ -1,7 +1,7 @@ +import { Omit } from '@material-ui/types'; import { ListItemTypeMap, ListItemProps } from '../ListItem'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ExtendButtonBase } from '../ButtonBase'; -import { Omit } from '@material-ui/types'; export type MenuItemClassKey = 'root' | 'gutters' | 'selected' | 'dense'; diff --git a/packages/material-ui/src/Modal/Modal.d.ts b/packages/material-ui/src/Modal/Modal.d.ts index 00fb27885619fa..7ee24693098d76 100644 --- a/packages/material-ui/src/Modal/Modal.d.ts +++ b/packages/material-ui/src/Modal/Modal.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StandardProps, ModalManager } from '..'; +import { StandardProps } from '..'; import { BackdropProps } from '../Backdrop'; import { PortalProps } from '../Portal'; diff --git a/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js b/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js index dae353bff0cdc8..f85fb34d38916f 100644 --- a/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js +++ b/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import OutlinedInput from './OutlinedInput'; import InputBase from '../InputBase'; diff --git a/packages/material-ui/src/Popover/Popover.js b/packages/material-ui/src/Popover/Popover.js index d123bd4f501506..115e67444d27f2 100644 --- a/packages/material-ui/src/Popover/Popover.js +++ b/packages/material-ui/src/Popover/Popover.js @@ -7,8 +7,8 @@ import { refType, HTMLElementType, } from '@material-ui/utils'; -import debounce from '../utils/debounce'; import clsx from 'clsx'; +import debounce from '../utils/debounce'; import ownerDocument from '../utils/ownerDocument'; import ownerWindow from '../utils/ownerWindow'; import createChainedFunction from '../utils/createChainedFunction'; diff --git a/packages/material-ui/src/RadioGroup/RadioGroup.test.js b/packages/material-ui/src/RadioGroup/RadioGroup.test.js index 28f34d56fc2db2..6d2785aa0c0e22 100644 --- a/packages/material-ui/src/RadioGroup/RadioGroup.test.js +++ b/packages/material-ui/src/RadioGroup/RadioGroup.test.js @@ -4,8 +4,8 @@ import { spy } from 'sinon'; import * as PropTypes from 'prop-types'; import { findOutermostIntrinsic } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormGroup from '../FormGroup'; import Radio from '../Radio'; import RadioGroup from './RadioGroup'; diff --git a/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts b/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts index ae3fa093db4b42..f4eb93c9c18113 100644 --- a/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts +++ b/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts @@ -1,4 +1,3 @@ -import { Context } from 'react'; import { RadioGroupProps } from './RadioGroup'; export interface RadioGroupState extends Pick {} diff --git a/packages/material-ui/src/Select/Select.test.js b/packages/material-ui/src/Select/Select.test.js index 669dd7da941b7b..12b558c4352cb8 100644 --- a/packages/material-ui/src/Select/Select.test.js +++ b/packages/material-ui/src/Select/Select.test.js @@ -1,5 +1,6 @@ import * as React from 'react'; import { expect } from 'chai'; +import { spy, stub, useFakeTimers } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; @@ -9,7 +10,6 @@ import MenuItem from '../MenuItem'; import Input from '../Input'; import InputLabel from '../InputLabel'; import Select from './Select'; -import { spy, stub, useFakeTimers } from 'sinon'; describe('', () => { let classes; diff --git a/packages/material-ui/src/Select/SelectInput.js b/packages/material-ui/src/Select/SelectInput.js index 27446e29a57061..bb4b0f97de6790 100644 --- a/packages/material-ui/src/Select/SelectInput.js +++ b/packages/material-ui/src/Select/SelectInput.js @@ -3,9 +3,9 @@ import { isFragment } from 'react-is'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import MuiError from '@material-ui/utils/macros/MuiError.macro'; +import { refType } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import capitalize from '../utils/capitalize'; -import { refType } from '@material-ui/utils'; import Menu from '../Menu/Menu'; import { isFilled } from '../InputBase/utils'; import useForkRef from '../utils/useForkRef'; diff --git a/packages/material-ui/src/Slide/Slide.d.ts b/packages/material-ui/src/Slide/Slide.d.ts index 1f25d0931037b8..fddc05aa073417 100644 --- a/packages/material-ui/src/Slide/Slide.d.ts +++ b/packages/material-ui/src/Slide/Slide.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface SlideProps extends TransitionProps { diff --git a/packages/material-ui/src/Slide/Slide.js b/packages/material-ui/src/Slide/Slide.js index 05bf9eb0ec5a83..02d1186c017c54 100644 --- a/packages/material-ui/src/Slide/Slide.js +++ b/packages/material-ui/src/Slide/Slide.js @@ -1,9 +1,9 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import * as ReactDOM from 'react-dom'; -import debounce from '../utils/debounce'; import { Transition } from 'react-transition-group'; import { elementAcceptingRef } from '@material-ui/utils'; +import debounce from '../utils/debounce'; import useForkRef from '../utils/useForkRef'; import useTheme from '../styles/useTheme'; import { duration } from '../styles/transitions'; diff --git a/packages/material-ui/src/Slide/Slide.test.js b/packages/material-ui/src/Slide/Slide.test.js index 15b18a2fc3d342..364889730fdc75 100644 --- a/packages/material-ui/src/Slide/Slide.test.js +++ b/packages/material-ui/src/Slide/Slide.test.js @@ -3,13 +3,13 @@ import { expect } from 'chai'; import { spy, stub, useFakeTimers } from 'sinon'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; -import Slide, { setTranslateValue } from './Slide'; import { createMuiTheme, ThemeProvider, unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, } from '@material-ui/core/styles'; import { Transition } from 'react-transition-group'; +import Slide, { setTranslateValue } from './Slide'; import { useForkRef } from '../utils'; describe('', () => { diff --git a/packages/material-ui/src/Step/Step.d.ts b/packages/material-ui/src/Step/Step.d.ts index 40e75292b1e5bf..e89f479a78de77 100644 --- a/packages/material-ui/src/Step/Step.d.ts +++ b/packages/material-ui/src/Step/Step.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { StandardProps } from '..'; -import { Orientation } from '../Stepper'; export interface StepProps extends StandardProps, StepClasskey> { diff --git a/packages/material-ui/src/Step/Step.test.js b/packages/material-ui/src/Step/Step.test.js index 23d05ef7fd8d90..143927893efe15 100644 --- a/packages/material-ui/src/Step/Step.test.js +++ b/packages/material-ui/src/Step/Step.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Step from './Step'; import Stepper from '../Stepper'; import StepLabel from '../StepLabel'; diff --git a/packages/material-ui/src/StepButton/StepButton.d.ts b/packages/material-ui/src/StepButton/StepButton.d.ts index 266f0834d01b3c..54f4673dd925ea 100644 --- a/packages/material-ui/src/StepButton/StepButton.d.ts +++ b/packages/material-ui/src/StepButton/StepButton.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Orientation } from '../Stepper'; import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; diff --git a/packages/material-ui/src/StepButton/StepButton.test.js b/packages/material-ui/src/StepButton/StepButton.test.js index ff9aa661aea8f3..a1f5a5880dfa2f 100644 --- a/packages/material-ui/src/StepButton/StepButton.test.js +++ b/packages/material-ui/src/StepButton/StepButton.test.js @@ -3,13 +3,13 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import { fireEvent } from '@testing-library/dom'; +import describeConformance from '../test-utils/describeConformance'; import StepButton from './StepButton'; import Step from '../Step'; import StepLabel from '../StepLabel'; import ButtonBase from '../ButtonBase'; -import { fireEvent } from '@testing-library/dom'; describe('', () => { let classes; diff --git a/packages/material-ui/src/StepContent/StepContent.d.ts b/packages/material-ui/src/StepContent/StepContent.d.ts index 596eeb5bf262c5..1b956ab7118cd4 100644 --- a/packages/material-ui/src/StepContent/StepContent.d.ts +++ b/packages/material-ui/src/StepContent/StepContent.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { StandardProps } from '..'; -import { Orientation } from '../Stepper'; import { TransitionProps } from '../transitions/transition'; export interface StepContentProps diff --git a/packages/material-ui/src/Stepper/Stepper.test.js b/packages/material-ui/src/Stepper/Stepper.test.js index 229848f518550f..73071719741384 100644 --- a/packages/material-ui/src/Stepper/Stepper.test.js +++ b/packages/material-ui/src/Stepper/Stepper.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Paper from '../Paper'; import Step from '../Step'; import StepLabel from '../StepLabel'; diff --git a/packages/material-ui/src/Switch/Switch.test.js b/packages/material-ui/src/Switch/Switch.test.js index 3e6b57a69006ad..0e663f2d5ad10f 100644 --- a/packages/material-ui/src/Switch/Switch.test.js +++ b/packages/material-ui/src/Switch/Switch.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl from '../FormControl'; import Switch from './Switch'; diff --git a/packages/material-ui/src/Tab/Tab.test.js b/packages/material-ui/src/Tab/Tab.test.js index afb365bc0e0145..f54d96814e5f42 100644 --- a/packages/material-ui/src/Tab/Tab.test.js +++ b/packages/material-ui/src/Tab/Tab.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Tab from './Tab'; import ButtonBase from '../ButtonBase'; diff --git a/packages/material-ui/src/Table/Table.test.js b/packages/material-ui/src/Table/Table.test.js index cc9af272d8cad5..d01cceefed7935 100644 --- a/packages/material-ui/src/Table/Table.test.js +++ b/packages/material-ui/src/Table/Table.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Table from './Table'; import TableContext from './TableContext'; diff --git a/packages/material-ui/src/TableBody/TableBody.test.js b/packages/material-ui/src/TableBody/TableBody.test.js index ef929c17c46452..511a8b84c13e4e 100644 --- a/packages/material-ui/src/TableBody/TableBody.test.js +++ b/packages/material-ui/src/TableBody/TableBody.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableBody from './TableBody'; import Tablelvl2Context from '../Table/Tablelvl2Context'; diff --git a/packages/material-ui/src/TableFooter/TableFooter.test.js b/packages/material-ui/src/TableFooter/TableFooter.test.js index bc3feab52c61e8..03fd191a41e2c9 100644 --- a/packages/material-ui/src/TableFooter/TableFooter.test.js +++ b/packages/material-ui/src/TableFooter/TableFooter.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableFooter from './TableFooter'; import Tablelvl2Context from '../Table/Tablelvl2Context'; diff --git a/packages/material-ui/src/TableHead/TableHead.test.js b/packages/material-ui/src/TableHead/TableHead.test.js index 9c047fcb191a7f..5498999120c7bc 100644 --- a/packages/material-ui/src/TableHead/TableHead.test.js +++ b/packages/material-ui/src/TableHead/TableHead.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableHead from './TableHead'; import Tablelvl2Context from '../Table/Tablelvl2Context'; diff --git a/packages/material-ui/src/TablePagination/TablePagination.d.ts b/packages/material-ui/src/TablePagination/TablePagination.d.ts index 4fbdab95b7dfd6..b192123b31f4b1 100644 --- a/packages/material-ui/src/TablePagination/TablePagination.d.ts +++ b/packages/material-ui/src/TablePagination/TablePagination.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { Omit } from '@material-ui/types'; +import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TablePaginationActionsProps } from './TablePaginationActions'; import { TableCellProps } from '../TableCell'; import { IconButtonProps } from '../IconButton'; diff --git a/packages/material-ui/src/TableRow/TableRow.test.js b/packages/material-ui/src/TableRow/TableRow.test.js index 88218e6df43b99..4380f9a98b0af2 100644 --- a/packages/material-ui/src/TableRow/TableRow.test.js +++ b/packages/material-ui/src/TableRow/TableRow.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableRow from './TableRow'; describe('', () => { diff --git a/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts b/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts index b61c24e936ad4d..b8680d9fa15ce6 100644 --- a/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts +++ b/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; -import { SvgIconProps } from '../SvgIcon'; import { OverrideProps } from '../OverridableComponent'; export type TableSortLabelTypeMap< diff --git a/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js b/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js index b935958380f94b..b2ea91a66c0b34 100644 --- a/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js +++ b/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js @@ -3,10 +3,10 @@ import { expect } from 'chai'; import { createClientRender } from 'test/utils/createClientRender'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; +import Sort from '@material-ui/icons/Sort'; import describeConformance from '../test-utils/describeConformance'; import TableSortLabel from './TableSortLabel'; import ButtonBase from '../ButtonBase'; -import Sort from '@material-ui/icons/Sort'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui/src/Tabs/ScrollbarSize.test.js b/packages/material-ui/src/Tabs/ScrollbarSize.test.js index 232b1e4d580b83..7ea3f5deef5960 100644 --- a/packages/material-ui/src/Tabs/ScrollbarSize.test.js +++ b/packages/material-ui/src/Tabs/ScrollbarSize.test.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { spy, useFakeTimers, stub } from 'sinon'; -import ScrollbarSize from './ScrollbarSize'; import { createClientRender } from 'test/utils/createClientRender'; +import ScrollbarSize from './ScrollbarSize'; describe('', () => { let clock; diff --git a/packages/material-ui/src/Tabs/Tabs.js b/packages/material-ui/src/Tabs/Tabs.js index b37ea86c69bd7f..7e75fda39c7718 100644 --- a/packages/material-ui/src/Tabs/Tabs.js +++ b/packages/material-ui/src/Tabs/Tabs.js @@ -197,6 +197,8 @@ const Tabs = React.forwardRef(function Tabs(props, ref) { [size]: tabMeta ? tabMeta[size] : 0, }; + // IE 11 support, replace with Number.isNaN + // eslint-disable-next-line no-restricted-globals if (isNaN(indicatorStyle[start]) || isNaN(indicatorStyle[size])) { setIndicatorStyle(newIndicatorStyle); } else { diff --git a/packages/material-ui/src/TextField/TextField.test.js b/packages/material-ui/src/TextField/TextField.test.js index 2455634be3aef2..d5d239ed94250e 100644 --- a/packages/material-ui/src/TextField/TextField.test.js +++ b/packages/material-ui/src/TextField/TextField.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl from '../FormControl'; import Input from '../Input'; import OutlinedInput from '../OutlinedInput'; diff --git a/packages/material-ui/src/Toolbar/Toolbar.test.js b/packages/material-ui/src/Toolbar/Toolbar.test.js index 0d00f02fbddcee..72f7b61b88b4e7 100644 --- a/packages/material-ui/src/Toolbar/Toolbar.test.js +++ b/packages/material-ui/src/Toolbar/Toolbar.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Toolbar from './Toolbar'; describe('', () => { diff --git a/packages/material-ui/src/Tooltip/Tooltip.test.js b/packages/material-ui/src/Tooltip/Tooltip.test.js index 3787507c56f438..fb7c772e7a2a84 100644 --- a/packages/material-ui/src/Tooltip/Tooltip.test.js +++ b/packages/material-ui/src/Tooltip/Tooltip.test.js @@ -3,11 +3,11 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; +import { camelCase } from 'lodash/string'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; import describeConformance from '../test-utils/describeConformance'; import Tooltip, { testReset } from './Tooltip'; import Input from '../Input'; -import { camelCase } from 'lodash/string'; function focusVisible(element) { act(() => { diff --git a/packages/material-ui/src/Typography/Typography.d.ts b/packages/material-ui/src/Typography/Typography.d.ts index 3d71c929242923..c965102f68324b 100644 --- a/packages/material-ui/src/Typography/Typography.d.ts +++ b/packages/material-ui/src/Typography/Typography.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { StandardProps, PropTypes } from '..'; -import { OverrideProps, OverridableTypeMap, OverridableComponent } from '../OverridableComponent'; +import { PropTypes } from '..'; +import { OverrideProps, OverridableComponent } from '../OverridableComponent'; import { Variant } from '../styles/createTypography'; export interface TypographyTypeMap { diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts index 6a29f198d9b44f..f2413e553a356d 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import * as React from 'react'; export interface TrapFocusProps { diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js index 97fac726d1169e..6d33026259c8c6 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js @@ -1,10 +1,10 @@ -/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex, camelcase */ +/* eslint-disable @typescript-eslint/naming-convention, consistent-return, jsx-a11y/no-noninteractive-tabindex */ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; +import { exactProp } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import useForkRef from '../utils/useForkRef'; -import { exactProp } from '@material-ui/utils'; /** * Utility component that locks focus inside the component. diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js index 087bb43fbc7fae..5bc05483297738 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { useFakeTimers } from 'sinon'; import { expect } from 'chai'; -import TrapFocus from './Unstable_TrapFocus'; import { createClientRender, fireEvent, screen } from 'test/utils/createClientRender'; +import TrapFocus from './Unstable_TrapFocus'; import Portal from '../Portal'; describe('', () => { diff --git a/packages/material-ui/src/Zoom/Zoom.d.ts b/packages/material-ui/src/Zoom/Zoom.d.ts index ca1a5e1d5ce279..09b89ac4c3032d 100644 --- a/packages/material-ui/src/Zoom/Zoom.d.ts +++ b/packages/material-ui/src/Zoom/Zoom.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface ZoomProps extends TransitionProps { diff --git a/packages/material-ui/src/Zoom/Zoom.test.js b/packages/material-ui/src/Zoom/Zoom.test.js index edb4e95f8ee2b0..f06cb73bd92c8d 100644 --- a/packages/material-ui/src/Zoom/Zoom.test.js +++ b/packages/material-ui/src/Zoom/Zoom.test.js @@ -3,11 +3,11 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; +import { Transition } from 'react-transition-group'; import { unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, ThemeProvider, } from '../styles'; -import { Transition } from 'react-transition-group'; import Zoom from './Zoom'; describe('', () => { diff --git a/packages/material-ui/src/index.d.ts b/packages/material-ui/src/index.d.ts index d43649def02d15..a3a8c91cb8be64 100644 --- a/packages/material-ui/src/index.d.ts +++ b/packages/material-ui/src/index.d.ts @@ -1,6 +1,7 @@ import * as React from 'react'; import { Omit } from '@material-ui/types'; import { StyledComponentProps } from './styles'; + export { StyledComponentProps }; /** @@ -51,6 +52,7 @@ export namespace PropTypes { } // From index.js +// eslint-disable-next-line import/first import * as colors from './colors'; export { colors }; diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js index 55f554af478a7c..f7fb087b59eae6 100644 --- a/packages/material-ui/src/index.js +++ b/packages/material-ui/src/index.js @@ -339,7 +339,6 @@ export * from './Tooltip'; export { default as Typography } from './Typography'; export * from './Typography'; -// eslint-disable-next-line camelcase export { default as Unstable_TrapFocus } from './Unstable_TrapFocus'; export * from './Unstable_TrapFocus'; diff --git a/packages/material-ui/src/internal/SwitchBase.test.js b/packages/material-ui/src/internal/SwitchBase.test.js index b09d42611ebffb..79664390d0fe18 100644 --- a/packages/material-ui/src/internal/SwitchBase.test.js +++ b/packages/material-ui/src/internal/SwitchBase.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import SwitchBase from './SwitchBase'; import FormControl, { useFormControl } from '../FormControl'; import IconButton from '../IconButton'; diff --git a/packages/material-ui/src/styles/colorManipulator.js b/packages/material-ui/src/styles/colorManipulator.js index e228e9ca01be6a..5b9e874efe1858 100644 --- a/packages/material-ui/src/styles/colorManipulator.js +++ b/packages/material-ui/src/styles/colorManipulator.js @@ -1,5 +1,5 @@ import MuiError from '@material-ui/utils/macros/MuiError.macro'; -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ /** * Returns a number whose value is limited to the given range. diff --git a/packages/material-ui/src/styles/createTypography.d.ts b/packages/material-ui/src/styles/createTypography.d.ts index 42243fb6b03155..27edadb55f37b1 100644 --- a/packages/material-ui/src/styles/createTypography.d.ts +++ b/packages/material-ui/src/styles/createTypography.d.ts @@ -1,5 +1,5 @@ -import { Palette } from './createPalette'; import * as React from 'react'; +import { Palette } from './createPalette'; import { CSSProperties } from './withStyles'; export type Variant = diff --git a/packages/material-ui/src/styles/index.js b/packages/material-ui/src/styles/index.js index 4b20b716f13994..53625e9e785c29 100644 --- a/packages/material-ui/src/styles/index.js +++ b/packages/material-ui/src/styles/index.js @@ -1,6 +1,5 @@ export * from './colorManipulator'; export { default as createMuiTheme } from './createMuiTheme'; -// eslint-disable-next-line camelcase export { default as unstable_createMuiStrictModeTheme } from './createMuiStrictModeTheme'; export { default as createStyles } from './createStyles'; export { default as makeStyles } from './makeStyles'; diff --git a/packages/material-ui/src/styles/makeStyles.d.ts b/packages/material-ui/src/styles/makeStyles.d.ts index 0581923403e100..07908af194078f 100644 --- a/packages/material-ui/src/styles/makeStyles.d.ts +++ b/packages/material-ui/src/styles/makeStyles.d.ts @@ -1,7 +1,6 @@ -import { Theme as DefaultTheme } from './createMuiTheme'; import { ClassNameMap, Styles, WithStylesOptions } from '@material-ui/styles/withStyles'; - import { Omit } from '@material-ui/types'; +import { Theme as DefaultTheme } from './createMuiTheme'; /** * `makeStyles` where the passed `styles` do not depend on props diff --git a/packages/material-ui/src/styles/responsiveFontSizes.test.js b/packages/material-ui/src/styles/responsiveFontSizes.test.js index 2221406cb38fb6..bd9d7e4d7cfaeb 100644 --- a/packages/material-ui/src/styles/responsiveFontSizes.test.js +++ b/packages/material-ui/src/styles/responsiveFontSizes.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import responsiveFontSizes from './responsiveFontSizes'; import { createMuiTheme } from '@material-ui/core/styles'; +import responsiveFontSizes from './responsiveFontSizes'; describe('responsiveFontSizes', () => { it('should support unitless line height', () => { diff --git a/packages/material-ui/src/styles/styled.d.ts b/packages/material-ui/src/styles/styled.d.ts index 0414fde1bfd65c..6ed2805893d232 100644 --- a/packages/material-ui/src/styles/styled.d.ts +++ b/packages/material-ui/src/styles/styled.d.ts @@ -1,3 +1,4 @@ +import * as React from 'react'; import { Omit } from '@material-ui/types'; import { CreateCSSProperties, @@ -5,7 +6,6 @@ import { WithStylesOptions, } from '@material-ui/styles/withStyles'; import { Theme as DefaultTheme } from './createMuiTheme'; -import * as React from 'react'; // These definitions are almost identical to the ones in @material-ui/styles/styled // Only difference is that ComponentCreator has a default theme type diff --git a/packages/material-ui/src/styles/transitions.js b/packages/material-ui/src/styles/transitions.js index 6012d67fbd8bd3..a127a1c0c55326 100644 --- a/packages/material-ui/src/styles/transitions.js +++ b/packages/material-ui/src/styles/transitions.js @@ -53,6 +53,8 @@ export default { if (process.env.NODE_ENV !== 'production') { const isString = (value) => typeof value === 'string'; + // IE 11 support, replace with Number.isNaN + // eslint-disable-next-line no-restricted-globals const isNumber = (value) => !isNaN(parseFloat(value)); if (!isString(props) && !Array.isArray(props)) { console.error('Material-UI: Argument "props" must be a string or Array.'); diff --git a/packages/material-ui/src/styles/transitions.test.js b/packages/material-ui/src/styles/transitions.test.js index 6d537db1bfa80f..665ba3c847b8ce 100644 --- a/packages/material-ui/src/styles/transitions.test.js +++ b/packages/material-ui/src/styles/transitions.test.js @@ -138,10 +138,13 @@ describe('transitions', () => { it('should return NaN when passed a negative number', () => { const zeroHeightDurationNegativeOne = transitions.getAutoHeightDuration(-1); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationNegativeOne)).to.equal(true); const zeroHeightDurationSmallNegative = transitions.getAutoHeightDuration(-0.000001); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationSmallNegative)).to.equal(true); const zeroHeightDurationBigNegative = transitions.getAutoHeightDuration(-100000); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationBigNegative)).to.equal(true); }); diff --git a/packages/material-ui/src/styles/withStyles.d.ts b/packages/material-ui/src/styles/withStyles.d.ts index 6b0b2ed5879eae..6b68913f544c09 100644 --- a/packages/material-ui/src/styles/withStyles.d.ts +++ b/packages/material-ui/src/styles/withStyles.d.ts @@ -1,5 +1,4 @@ import { PropInjector } from '@material-ui/types'; -import { Theme } from './createMuiTheme'; import { CreateCSSProperties, CSSProperties, @@ -12,6 +11,7 @@ import { ClassKeyOfStyles, BaseCSSProperties, } from '@material-ui/styles/withStyles'; +import { Theme } from './createMuiTheme'; export { CreateCSSProperties, diff --git a/packages/material-ui/src/styles/withTheme.d.ts b/packages/material-ui/src/styles/withTheme.d.ts index 70025c9a048c54..8d07025e82ca75 100644 --- a/packages/material-ui/src/styles/withTheme.d.ts +++ b/packages/material-ui/src/styles/withTheme.d.ts @@ -1,5 +1,5 @@ -import { Theme } from './createMuiTheme'; import { PropInjector } from '@material-ui/types'; +import { Theme } from './createMuiTheme'; export interface WithTheme { theme: Theme; diff --git a/packages/material-ui/src/test-utils/createMount.js b/packages/material-ui/src/test-utils/createMount.js index ca52bd6bec0cdf..6fe43e024cfaf0 100644 --- a/packages/material-ui/src/test-utils/createMount.js +++ b/packages/material-ui/src/test-utils/createMount.js @@ -24,6 +24,7 @@ class Mode extends React.Component { render() { // Excess props will come from e.g. enzyme setProps + // eslint-disable-next-line @typescript-eslint/naming-convention const { __element, __strict, ...other } = this.props; const Component = __strict ? React.StrictMode : React.Fragment; diff --git a/packages/material-ui/src/test-utils/describeConformance.js b/packages/material-ui/src/test-utils/describeConformance.js index e60a1cca092b7b..1b88b58a8bf36e 100644 --- a/packages/material-ui/src/test-utils/describeConformance.js +++ b/packages/material-ui/src/test-utils/describeConformance.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as React from 'react'; -import findOutermostIntrinsic from './findOutermostIntrinsic'; import ReactTestRenderer from 'react-test-renderer'; +import findOutermostIntrinsic from './findOutermostIntrinsic'; import testRef from './testRef'; /** diff --git a/packages/material-ui/src/utils/index.js b/packages/material-ui/src/utils/index.js index a79c386cfc4104..0c5cddfc7f77ed 100644 --- a/packages/material-ui/src/utils/index.js +++ b/packages/material-ui/src/utils/index.js @@ -12,6 +12,5 @@ export { default as unsupportedProp } from './unsupportedProp'; export { default as useControlled } from './useControlled'; export { default as useEventCallback } from './useEventCallback'; export { default as useForkRef } from './useForkRef'; -// eslint-disable-next-line camelcase export { default as unstable_useId } from './unstable_useId'; export { default as useIsFocusVisible } from './useIsFocusVisible'; diff --git a/packages/material-ui/src/utils/isMuiElement.d.ts b/packages/material-ui/src/utils/isMuiElement.d.ts index bfb5df3b456eef..ffca03d9a690c2 100644 --- a/packages/material-ui/src/utils/isMuiElement.d.ts +++ b/packages/material-ui/src/utils/isMuiElement.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StandardProps } from '../'; +import { StandardProps } from '..'; export type NamedMuiComponent = React.ComponentType & { muiName: string }; diff --git a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts b/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts index fed68f6668aa72..2bbe60bcff0f62 100644 --- a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts +++ b/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts @@ -1,6 +1,6 @@ +import { PropInjector } from '@material-ui/types'; import { Breakpoint } from '../styles/createBreakpoints'; import { WithWidth } from '../withWidth'; -import { PropInjector } from '@material-ui/types'; export interface WithMobileDialogOptions { breakpoint: Breakpoint; diff --git a/packages/material-ui/src/withWidth/withWidth.d.ts b/packages/material-ui/src/withWidth/withWidth.d.ts index 64669acfd1abc0..7d76ce474a7509 100644 --- a/packages/material-ui/src/withWidth/withWidth.d.ts +++ b/packages/material-ui/src/withWidth/withWidth.d.ts @@ -1,5 +1,5 @@ -import { Breakpoint } from '../styles/createBreakpoints'; import { PropInjector } from '@material-ui/types'; +import { Breakpoint } from '../styles/createBreakpoints'; export interface WithWidthOptions { withTheme?: boolean; diff --git a/packages/material-ui/test/typescript/components.spec.tsx b/packages/material-ui/test/typescript/components.spec.tsx index e41a804807a67b..636b042a9df8cb 100644 --- a/packages/material-ui/test/typescript/components.spec.tsx +++ b/packages/material-ui/test/typescript/components.spec.tsx @@ -215,8 +215,7 @@ const CardTest = () => ( adjective well meaning and kindly. - - {'"a benevolent smile"'} + a benevolent smile @@ -233,7 +232,7 @@ const CardMediaTest = () => ( subheader="September 14, 2016" /> - + @@ -252,7 +251,7 @@ const CardMediaTest = () => ( - + Method: @@ -288,7 +287,7 @@ const ChipsTest = () => ( M} label="Clickable Chip" onClick={(e) => log(e)} /> - } label="Deletable Chip" onDelete={(e) => log(e)} /> + } label="Deletable Chip" onDelete={(e) => log(e)} /> @@ -305,7 +304,7 @@ const ChipsTest = () => ( const DialogTest = () => { const emails = ['username@gmail.com', 'user02@gmail.com']; return ( - log(e)} open> + log(event)} open> Set backup account @@ -399,14 +398,19 @@ const DrawerTest = () => { }; return ( - log(e)} onClick={(e) => log(e)}> + log(event)} + onClick={(e) => log(e)} + > List log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} ModalProps={{ hideBackdrop: true, @@ -418,7 +422,7 @@ const DrawerTest = () => { anchor="bottom" variant="temporary" open={open.bottom} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} > List @@ -427,7 +431,7 @@ const DrawerTest = () => { variant="persistent" anchor="right" open={open.right} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} > List @@ -447,7 +451,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -456,7 +460,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} ModalProps={{ @@ -468,7 +472,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -478,7 +482,7 @@ const SwipeableDrawerTest = () => { variant="temporary" anchor="right" open={open.right} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -516,7 +520,7 @@ const GridTest = () => ( ... - + ... @@ -538,7 +542,7 @@ const ListTest = () => ( {[0, 1, 2, 3].map((value) => ( log(e)}> - + @@ -566,8 +570,8 @@ const MenuTest = () => { log(e)} + open + onClose={(event) => log(event)} PopoverClasses={{ paper: 'foo' }} > {options.map((option, index) => ( @@ -691,9 +695,7 @@ const SelectionControlTest = () => { label="Indeterminate" /> - } + control={} label="Custom color" /> @@ -744,9 +746,9 @@ const SnackbarTest = () => ( vertical: 'bottom', horizontal: 'left', }} - open={true} + open autoHideDuration={6000} - onClose={(e) => log(e)} + onClose={(event) => log(event)} ContentProps={ { // 'aria-describedby': 'message-id', @@ -942,9 +944,9 @@ const TabsTest = () => { - {this.state.value === 0 && {'Item One'}} - {this.state.value === 1 && {'Item Two'}} - {this.state.value === 2 && {'Item Three'}} + {this.state.value === 0 && Item One} + {this.state.value === 1 && Item Two} + {this.state.value === 2 && Item Three} ); } @@ -955,15 +957,15 @@ const TabsTest = () => { const TextFieldTest = () => ( - - Name} value={'Alice'} /> + + Name} value="Alice" /> log({ name: event.currentTarget.value })} /> - + ( ); const LinkTest = () => { - const dudUrl = 'javascript:;'; + const dudUrl = 'javascript'; return ( Link - {'color="inherit"'} + inherit - {'variant="body1"'} + body1 ); diff --git a/packages/material-ui/test/typescript/styles.spec.tsx b/packages/material-ui/test/typescript/styles.spec.tsx index 6be0f6dd690aa1..fdc313eaeb1e5b 100644 --- a/packages/material-ui/test/typescript/styles.spec.tsx +++ b/packages/material-ui/test/typescript/styles.spec.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/rules-of-hooks */ import * as React from 'react'; import { createStyles, @@ -164,7 +165,7 @@ const t5 = createMuiTheme().spacing(1, 2, 3, 4, 5); function OverridesTheme() { return ( - {'Overrides'} + Overrides ); } @@ -488,7 +489,7 @@ withStyles((theme) => { // https://github.com/mui-org/material-ui/pull/15546 // Update type definition to let CSS properties be functions - interface testProps { + interface TestProps { foo: boolean; } @@ -496,10 +497,10 @@ withStyles((theme) => { const useStyles = makeStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), }), }); @@ -511,10 +512,10 @@ withStyles((theme) => { const useStyles = makeStyles((theme) => ({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), margin: theme.spacing(1), }), })); @@ -527,10 +528,10 @@ withStyles((theme) => { const styles = createStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), }), }); @@ -542,10 +543,10 @@ withStyles((theme) => { withStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), margin: 8, }), }); @@ -555,10 +556,10 @@ withStyles((theme) => { withStyles((theme) => ({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), height: theme.spacing(1), }), })); @@ -618,18 +619,18 @@ withStyles((theme) => return { padding: theme.spacing(1) }; }); - interface myProps { + interface MyProps { testValue: boolean; } // Type of props follow all the way to css properties - styled(Button)(({ theme, testValue }) => { + styled(Button)(({ theme, testValue }) => { expectType(theme); expectType(testValue); return { padding: (props) => { - expectType(props); + expectType(props); expectType(props.testValue); return theme.spacing(1); diff --git a/packages/typescript-to-proptypes/test/options-test/options.ts b/packages/typescript-to-proptypes/test/options-test/options.ts index 85f340a76c7db1..0d76f3064bb9b8 100644 --- a/packages/typescript-to-proptypes/test/options-test/options.ts +++ b/packages/typescript-to-proptypes/test/options-test/options.ts @@ -6,6 +6,7 @@ const options: TestOptions = { if (name.endsWith('Props')) { return false; } + return true; }, }, injector: { diff --git a/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts b/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts index 5e9d3028d4404d..d9fddc0e5f9303 100644 --- a/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts +++ b/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + interface ButtonProps { variant?: string; } diff --git a/packages/typescript-to-proptypes/test/sort-unions/input.d.ts b/packages/typescript-to-proptypes/test/sort-unions/input.d.ts index 08d90791df5a95..5379600ee91549 100644 --- a/packages/typescript-to-proptypes/test/sort-unions/input.d.ts +++ b/packages/typescript-to-proptypes/test/sort-unions/input.d.ts @@ -1,5 +1,3 @@ -import * as React from 'react'; - type Breakpoint = 'xs' | 'md' | 'xl'; export interface Props { diff --git a/packages/typescript-to-proptypes/test/union-props/input.d.ts b/packages/typescript-to-proptypes/test/union-props/input.d.ts index a4b6a03347078d..551c9bcf1002ff 100644 --- a/packages/typescript-to-proptypes/test/union-props/input.d.ts +++ b/packages/typescript-to-proptypes/test/union-props/input.d.ts @@ -1,5 +1,3 @@ -import * as React from 'react'; - export interface BaseProps { value?: unknown; } diff --git a/scripts/generateProptypes.ts b/scripts/generateProptypes.ts index 37a4728700deae..e4033148770ada 100644 --- a/scripts/generateProptypes.ts +++ b/scripts/generateProptypes.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import * as path from 'path'; import * as fse from 'fs-extra'; import * as ttp from 'typescript-to-proptypes'; @@ -139,6 +140,8 @@ const getSortLiteralUnions: ttp.InjectOptions['getSortLiteralUnions'] = (compone ) { return sortBreakpointsLiteralByViewportAscending; } + + return undefined; }; const tsconfig = ttp.loadConfig(path.resolve(__dirname, '../tsconfig.json')); diff --git a/scripts/listChangedFiles.test.js b/scripts/listChangedFiles.test.js index 24a18d0240856e..5c1360a6e61fdb 100644 --- a/scripts/listChangedFiles.test.js +++ b/scripts/listChangedFiles.test.js @@ -1,8 +1,8 @@ -const listChangedFiles = require('./listChangedFiles'); const fs = require('fs'); const rimraf = require('rimraf'); const { promisify } = require('util'); const { expect } = require('chai'); +const listChangedFiles = require('./listChangedFiles'); const writeFileAsync = promisify(fs.writeFile); const rimrafAsync = promisify(rimraf); diff --git a/test/utils/components.js b/test/utils/components.js index c4ac86bb5590cb..76c47c494ed24a 100644 --- a/test/utils/components.js +++ b/test/utils/components.js @@ -13,7 +13,9 @@ export class ErrorBoundary extends React.Component { children: PropTypes.node.isRequired, }; - state = { error: null }; + state = { + error: null, + }; /** * @public diff --git a/test/utils/createMount.js b/test/utils/createMount.js index 1f9b00453a0f08..fcde56928f558f 100644 --- a/test/utils/createMount.js +++ b/test/utils/createMount.js @@ -28,6 +28,7 @@ class Mode extends React.Component { render() { // Excess props will come from e.g. enzyme setProps + // eslint-disable-next-line @typescript-eslint/naming-convention const { __element, __strict, ...other } = this.props; const Component = __strict ? React.StrictMode : React.Fragment; diff --git a/test/utils/initMatchers.js b/test/utils/initMatchers.js index f7e1e848ab9115..a80d7f19895272 100644 --- a/test/utils/initMatchers.js +++ b/test/utils/initMatchers.js @@ -148,7 +148,7 @@ chai.use((chaiAPI, utils) => { * Correct name for `to.be.visible` */ chai.Assertion.addMethod('toBeVisible', function toBeVisible() { - // eslint-disable-next-line no-underscore-dangle, no-unused-expressions + // eslint-disable-next-line no-underscore-dangle, @typescript-eslint/no-unused-expressions new chai.Assertion(this._obj).to.be.visible; }); }); diff --git a/yarn.lock b/yarn.lock index d84660f8a7fb30..cf256dd121a8b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -344,7 +344,7 @@ resolve "^1.13.1" v8flags "^3.1.1" -"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.10.4", "@babel/parser@^7.7.0", "@babel/parser@^7.7.5": +"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.10.4", "@babel/parser@^7.7.5": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.10.4.tgz#9eedf27e1998d87739fb5028a5120557c06a1a64" integrity sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA== @@ -1050,7 +1050,7 @@ "@babel/parser" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/traverse@^7.10.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.4": +"@babel/traverse@^7.10.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.10.4.tgz#e642e5395a3b09cc95c8e74a27432b484b697818" integrity sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q== @@ -1065,7 +1065,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@7.8.3", "@babel/types@7.9.6", "@babel/types@^7.0.0", "@babel/types@^7.10.2", "@babel/types@^7.10.4", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.6.1", "@babel/types@^7.7.0": +"@babel/types@7.8.3", "@babel/types@7.9.6", "@babel/types@^7.0.0", "@babel/types@^7.10.2", "@babel/types@^7.10.4", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.6.1": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.10.4.tgz#369517188352e18219981efd156bfdb199fff1ee" integrity sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg== @@ -2495,6 +2495,11 @@ "@types/cheerio" "*" "@types/react" "*" +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/eslint@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.0.tgz#eb5c5b575237334df24c53195e37b53d66478d7b" @@ -2565,7 +2570,7 @@ "@types/parse5" "*" "@types/tough-cookie" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.4": +"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.4": version "7.0.5" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ== @@ -2822,6 +2827,66 @@ dependencies: "@types/node" "*" +"@typescript-eslint/eslint-plugin@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.0.tgz#ba2b6cae478b8fca3f2e58ff1313e4198eea2d8a" + integrity sha512-ubHlHVt1lsPQB/CZdEov9XuOFhNG9YRC//kuiS1cMQI6Bs1SsqKrEmZnpgRwthGR09/kEDtr9MywlqXyyYd8GA== + dependencies: + "@typescript-eslint/experimental-utils" "3.6.0" + debug "^4.1.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.0.tgz#0138152d66e3e53a6340f606793fb257bf2d76a1" + integrity sha512-4Vdf2hvYMUnTdkCNZu+yYlFtL2v+N2R7JOynIOkFbPjf9o9wQvRwRkzUdWlFd2YiiUwJLbuuLnl5civNg5ykOQ== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/typescript-estree" "3.6.0" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + +"@typescript-eslint/parser@^3.1.0", "@typescript-eslint/parser@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.6.0.tgz#79b5232e1a2d06f1fc745942b690cd87aca7b60e" + integrity sha512-taghDxuLhbDAD1U5Fk8vF+MnR0yiFE9Z3v2/bYScFb0N1I9SK8eKHkdJl1DAD48OGFDMFTeOTX0z7g0W6SYUXw== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "3.6.0" + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/typescript-estree" "3.6.0" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/types@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.6.0.tgz#4bd6eee55d2f9d35a4b36c4804be1880bf68f7bc" + integrity sha512-JwVj74ohUSt0ZPG+LZ7hb95fW8DFOqBuR6gE7qzq55KDI3BepqsCtHfBIoa0+Xi1AI7fq5nCu2VQL8z4eYftqg== + +"@typescript-eslint/typescript-estree@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.0.tgz#9b4cab43f1192b64ff51530815b8919f166ce177" + integrity sha512-G57NDSABHjvob7zVV09ehWyD1K6/YUKjz5+AufObFyjNO4DVmKejj47MHjVHHlZZKgmpJD2yyH9lfCXHrPITFg== + dependencies: + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/visitor-keys" "3.6.0" + debug "^4.1.1" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/visitor-keys@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.0.tgz#44185eb0cc47651034faa95c5e2e8b314ecebb26" + integrity sha512-p1izllL2Ubwunite0ITjubuMQRBGgjdVYwyG7lXPX8GbrA6qF0uwSRz9MnXZaHMxID4948gX0Ez8v9tUDi/KfQ== + dependencies: + eslint-visitor-keys "^1.1.0" + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -3659,18 +3724,6 @@ babel-core@^7.0.0-bridge.0: resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== -babel-eslint@^10.0.3, babel-eslint@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - babel-loader@^8.0.0: version "8.1.0" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.1.0.tgz#c611d5112bd5209abe8b9fa84c3e4da25275f1c3" @@ -6787,7 +6840,7 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" -eslint-config-airbnb-base@^14.2.0: +eslint-config-airbnb-base@^14.1.0, eslint-config-airbnb-base@^14.2.0: version "14.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz#fe89c24b3f9dc8008c9c0d0d88c28f95ed65e9c4" integrity sha512-Snswd5oC6nJaevs3nZoLSTvGJBvzTfnBqOIArkf3cbyTyq9UD79wOk8s+RiL6bhca0p/eRO6veczhf6A/7Jy8Q== @@ -6796,7 +6849,16 @@ eslint-config-airbnb-base@^14.2.0: object.assign "^4.1.0" object.entries "^1.1.2" -eslint-config-airbnb@^18.2.0: +eslint-config-airbnb-typescript@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-8.0.2.tgz#465b17b0b1facdcca4fe23a5426bc27ab7b2b2f2" + integrity sha512-TCOftyCoIogJzzLGSg0Qlxd27qvf+1a3MHyN/PqynTqINS4iFy+SlXy/CrAN+6xkleGMSrvmPbm3pyFEku2+IQ== + dependencies: + "@typescript-eslint/parser" "^3.1.0" + eslint-config-airbnb "^18.1.0" + eslint-config-airbnb-base "^14.1.0" + +eslint-config-airbnb@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.0.tgz#8a82168713effce8fc08e10896a63f1235499dcd" integrity sha512-Fz4JIUKkrhO0du2cg5opdyPKQXOI2MvF8KUvN2710nJMT6jaRUpRE2swrJftAjVGL7T1otLM5ieo5RqS1v9Udg== @@ -6930,7 +6992,7 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^5.1.0: +eslint-scope@^5.0.0, eslint-scope@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w== @@ -6945,7 +7007,7 @@ eslint-utils@^2.0.0: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.2.0: +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -13653,7 +13715,7 @@ regexp.prototype.flags@^1.3.0: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" -regexpp@^3.1.0: +regexpp@^3.0.0, regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== @@ -15716,6 +15778,13 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" +tsutils@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
{ diff --git a/packages/material-ui/src/ButtonGroup/ButtonGroup.js b/packages/material-ui/src/ButtonGroup/ButtonGroup.js index f405cc87f74250..efbbfc01aee62a 100644 --- a/packages/material-ui/src/ButtonGroup/ButtonGroup.js +++ b/packages/material-ui/src/ButtonGroup/ButtonGroup.js @@ -8,7 +8,7 @@ import withStyles from '../styles/withStyles'; import Button from '../Button'; // Force a side effect so we don't have any override priority issue. -// eslint-disable-next-line no-unused-expressions +// eslint-disable-next-line @typescript-eslint/no-unused-expressions Button.styles; export const styles = (theme) => ({ diff --git a/packages/material-ui/src/Card/Card.d.ts b/packages/material-ui/src/Card/Card.d.ts index 684339eab7cda0..03d0a3d638c4c9 100644 --- a/packages/material-ui/src/Card/Card.d.ts +++ b/packages/material-ui/src/Card/Card.d.ts @@ -1,4 +1,3 @@ -import * as React from 'react'; import { StandardProps } from '..'; import { PaperProps } from '../Paper'; diff --git a/packages/material-ui/src/CardMedia/CardMedia.js b/packages/material-ui/src/CardMedia/CardMedia.js index 4670849bd47c06..60699a405001fc 100644 --- a/packages/material-ui/src/CardMedia/CardMedia.js +++ b/packages/material-ui/src/CardMedia/CardMedia.js @@ -1,8 +1,8 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; -import withStyles from '../styles/withStyles'; import { chainPropTypes } from '@material-ui/utils'; +import withStyles from '../styles/withStyles'; export const styles = { /* Styles applied to the root element. */ diff --git a/packages/material-ui/src/CardMedia/CardMedia.test.js b/packages/material-ui/src/CardMedia/CardMedia.test.js index 8296bc64cf2cc3..1d657a5ed7afea 100644 --- a/packages/material-ui/src/CardMedia/CardMedia.test.js +++ b/packages/material-ui/src/CardMedia/CardMedia.test.js @@ -1,11 +1,11 @@ import * as React from 'react'; +import PropTypes from 'prop-types'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import { createClientRender } from 'test/utils/createClientRender'; import describeConformance from '../test-utils/describeConformance'; import CardMedia from './CardMedia'; -import PropTypes from 'prop-types'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui/src/Checkbox/Checkbox.test.js b/packages/material-ui/src/Checkbox/Checkbox.test.js index bb04361debd3a7..a5f8d4f6df6d62 100644 --- a/packages/material-ui/src/Checkbox/Checkbox.test.js +++ b/packages/material-ui/src/Checkbox/Checkbox.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Checkbox from './Checkbox'; import FormControl from '../FormControl'; import IconButton from '../IconButton'; diff --git a/packages/material-ui/src/Chip/Chip.test.js b/packages/material-ui/src/Chip/Chip.test.js index 5ddccd80843872..7d533447e997e0 100644 --- a/packages/material-ui/src/Chip/Chip.test.js +++ b/packages/material-ui/src/Chip/Chip.test.js @@ -1,11 +1,11 @@ import * as React from 'react'; import { expect } from 'chai'; import { spy, stub } from 'sinon'; -import CheckBox from '../internal/svg-icons/CheckBox'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import CheckBox from '../internal/svg-icons/CheckBox'; +import describeConformance from '../test-utils/describeConformance'; import Avatar from '../Avatar'; import Chip from './Chip'; diff --git a/packages/material-ui/src/ClickAwayListener/ClickAwayListener.js b/packages/material-ui/src/ClickAwayListener/ClickAwayListener.js index d4039a3ab23833..cf5999ea564c7c 100644 --- a/packages/material-ui/src/ClickAwayListener/ClickAwayListener.js +++ b/packages/material-ui/src/ClickAwayListener/ClickAwayListener.js @@ -1,10 +1,10 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; +import { elementAcceptingRef, exactProp } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import useForkRef from '../utils/useForkRef'; import useEventCallback from '../utils/useEventCallback'; -import { elementAcceptingRef, exactProp } from '@material-ui/utils'; function mapEventPropToEvent(eventProp) { return eventProp.substring(2).toLowerCase(); diff --git a/packages/material-ui/src/Collapse/Collapse.d.ts b/packages/material-ui/src/Collapse/Collapse.d.ts index d3f4cccab1cfe3..78cc242030306c 100644 --- a/packages/material-ui/src/Collapse/Collapse.d.ts +++ b/packages/material-ui/src/Collapse/Collapse.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { StandardProps } from '..'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface CollapseProps extends StandardProps { diff --git a/packages/material-ui/src/Collapse/Collapse.test.js b/packages/material-ui/src/Collapse/Collapse.test.js index e953374fd58749..adc91fe3e4f24d 100644 --- a/packages/material-ui/src/Collapse/Collapse.test.js +++ b/packages/material-ui/src/Collapse/Collapse.test.js @@ -4,14 +4,14 @@ import { spy, stub, useFakeTimers } from 'sinon'; import { createClientRender } from 'test/utils/createClientRender'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; -import Collapse from './Collapse'; import { ThemeProvider, createMuiTheme, unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, } from '@material-ui/core/styles'; import { Transition } from 'react-transition-group'; +import describeConformance from '../test-utils/describeConformance'; +import Collapse from './Collapse'; describe('', () => { // StrictModeViolation: uses react-transition-group diff --git a/packages/material-ui/src/CssBaseline/CssBaseline.js b/packages/material-ui/src/CssBaseline/CssBaseline.js index d62176ddcde7db..7acda742d66f86 100644 --- a/packages/material-ui/src/CssBaseline/CssBaseline.js +++ b/packages/material-ui/src/CssBaseline/CssBaseline.js @@ -1,7 +1,7 @@ import * as React from 'react'; import PropTypes from 'prop-types'; -import withStyles from '../styles/withStyles'; import { exactProp } from '@material-ui/utils'; +import withStyles from '../styles/withStyles'; export const html = { WebkitFontSmoothing: 'antialiased', // Antialiasing. @@ -46,9 +46,8 @@ export const styles = (theme) => ({ * Kickstart an elegant, consistent, and simple baseline to build upon. */ function CssBaseline(props) { - /* eslint-disable no-unused-vars */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { children = null, classes } = props; - /* eslint-enable no-unused-vars */ return {children}; } diff --git a/packages/material-ui/src/Dialog/Dialog.test.js b/packages/material-ui/src/Dialog/Dialog.test.js index 6ebcbe85b3389e..329bad6efecd45 100644 --- a/packages/material-ui/src/Dialog/Dialog.test.js +++ b/packages/material-ui/src/Dialog/Dialog.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Modal from '../Modal'; import Dialog from './Dialog'; diff --git a/packages/material-ui/src/Drawer/Drawer.d.ts b/packages/material-ui/src/Drawer/Drawer.d.ts index e647049b5f42a4..7782dab4a69a25 100644 --- a/packages/material-ui/src/Drawer/Drawer.d.ts +++ b/packages/material-ui/src/Drawer/Drawer.d.ts @@ -3,7 +3,6 @@ import { StandardProps } from '..'; import { ModalProps } from '../Modal'; import { SlideProps } from '../Slide'; import { PaperProps } from '../Paper'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionHandlerProps, TransitionProps } from '../transitions/transition'; export interface DrawerProps diff --git a/packages/material-ui/src/Drawer/Drawer.test.js b/packages/material-ui/src/Drawer/Drawer.test.js index 4d841c28a0a417..c61b36716b7677 100644 --- a/packages/material-ui/src/Drawer/Drawer.test.js +++ b/packages/material-ui/src/Drawer/Drawer.test.js @@ -3,12 +3,12 @@ import { expect } from 'chai'; import { findOutermostIntrinsic, getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import { ThemeProvider, createMuiTheme } from '@material-ui/core/styles'; +import { createClientRender } from 'test/utils/createClientRender'; import describeConformance from '../test-utils/describeConformance'; import Slide from '../Slide'; import Paper from '../Paper'; import Modal from '../Modal'; import Drawer, { getAnchor, isHorizontal } from './Drawer'; -import { createClientRender } from 'test/utils/createClientRender'; describe('', () => { // StrictModeViolation: uses Slide diff --git a/packages/material-ui/src/Fade/Fade.test.js b/packages/material-ui/src/Fade/Fade.test.js index 5988c01903cdb9..6e0f7c83006ce0 100644 --- a/packages/material-ui/src/Fade/Fade.test.js +++ b/packages/material-ui/src/Fade/Fade.test.js @@ -7,8 +7,8 @@ import { } from '@material-ui/core/styles'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; -import Fade from './Fade'; import { Transition } from 'react-transition-group'; +import Fade from './Fade'; describe('', () => { // StrictModeViolation: uses react-transition-group diff --git a/packages/material-ui/src/FilledInput/FilledInput.test.js b/packages/material-ui/src/FilledInput/FilledInput.test.js index 00961ea39c5a0e..5d25fcf85c4c2e 100644 --- a/packages/material-ui/src/FilledInput/FilledInput.test.js +++ b/packages/material-ui/src/FilledInput/FilledInput.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FilledInput from './FilledInput'; import InputBase from '../InputBase'; diff --git a/packages/material-ui/src/FormControl/FormControl.js b/packages/material-ui/src/FormControl/FormControl.js index c327fe1b771ecf..638473c130ca92 100644 --- a/packages/material-ui/src/FormControl/FormControl.js +++ b/packages/material-ui/src/FormControl/FormControl.js @@ -119,8 +119,8 @@ const FormControl = React.forwardRef(function FormControl(props, ref) { return initialFilled; }); - const [_focused, setFocused] = React.useState(false); - const focused = visuallyFocused !== undefined ? visuallyFocused : _focused; + const [focusedState, setFocused] = React.useState(false); + const focused = visuallyFocused !== undefined ? visuallyFocused : focusedState; if (disabled && focused) { setFocused(false); diff --git a/packages/material-ui/src/FormControl/FormControl.test.js b/packages/material-ui/src/FormControl/FormControl.test.js index 9babe2411e70f7..d938cf14729790 100644 --- a/packages/material-ui/src/FormControl/FormControl.test.js +++ b/packages/material-ui/src/FormControl/FormControl.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Input from '../Input'; import Select from '../Select'; import FormControl from './FormControl'; diff --git a/packages/material-ui/src/FormControl/useFormControl.d.ts b/packages/material-ui/src/FormControl/useFormControl.d.ts index ab0e95221880f3..17b7806ebd0191 100644 --- a/packages/material-ui/src/FormControl/useFormControl.d.ts +++ b/packages/material-ui/src/FormControl/useFormControl.d.ts @@ -1,4 +1,3 @@ -import { Context } from 'react'; import { FormControlProps } from './FormControl'; // shut off automatic exporting diff --git a/packages/material-ui/src/FormControlLabel/FormControlLabel.test.js b/packages/material-ui/src/FormControlLabel/FormControlLabel.test.js index 5b1e7a5dda48d7..add81bfd6d2b17 100644 --- a/packages/material-ui/src/FormControlLabel/FormControlLabel.test.js +++ b/packages/material-ui/src/FormControlLabel/FormControlLabel.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Checkbox from '../Checkbox'; import FormControlLabel from './FormControlLabel'; import FormControl from '../FormControl'; diff --git a/packages/material-ui/src/FormHelperText/FormHelperText.test.js b/packages/material-ui/src/FormHelperText/FormHelperText.test.js index 502ba28c2d7fba..78db2d23675acf 100644 --- a/packages/material-ui/src/FormHelperText/FormHelperText.test.js +++ b/packages/material-ui/src/FormHelperText/FormHelperText.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormHelperText from './FormHelperText'; import FormControl from '../FormControl'; diff --git a/packages/material-ui/src/FormLabel/FormLabel.test.js b/packages/material-ui/src/FormLabel/FormLabel.test.js index 427c964ed25df0..a3b9396bfd9fc4 100644 --- a/packages/material-ui/src/FormLabel/FormLabel.test.js +++ b/packages/material-ui/src/FormLabel/FormLabel.test.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormLabel from './FormLabel'; import FormControl, { useFormControl } from '../FormControl'; diff --git a/packages/material-ui/src/GridListTile/GridListTile.js b/packages/material-ui/src/GridListTile/GridListTile.js index 68f7e24990c957..d08d9e4ff5a1ec 100644 --- a/packages/material-ui/src/GridListTile/GridListTile.js +++ b/packages/material-ui/src/GridListTile/GridListTile.js @@ -57,10 +57,10 @@ const GridListTile = React.forwardRef(function GridListTile(props, ref) { children, classes, className, - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars cols = 1, component: Component = 'li', - // eslint-disable-next-line no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars rows = 1, ...other } = props; diff --git a/packages/material-ui/src/Grow/Grow.d.ts b/packages/material-ui/src/Grow/Grow.d.ts index 2f18a9fe238fb6..5060672218f34e 100644 --- a/packages/material-ui/src/Grow/Grow.d.ts +++ b/packages/material-ui/src/Grow/Grow.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { Omit } from '@material-ui/types'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface GrowProps extends Omit { diff --git a/packages/material-ui/src/Grow/Grow.test.js b/packages/material-ui/src/Grow/Grow.test.js index d023797c7ca5ff..4d2266a8aed0f5 100644 --- a/packages/material-ui/src/Grow/Grow.test.js +++ b/packages/material-ui/src/Grow/Grow.test.js @@ -3,13 +3,13 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; -import Grow from './Grow'; import { createMuiTheme, ThemeProvider, unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, } from '@material-ui/core/styles'; import { Transition } from 'react-transition-group'; +import Grow from './Grow'; import useForkRef from '../utils/useForkRef'; describe('', () => { diff --git a/packages/material-ui/src/IconButton/IconButton.test.js b/packages/material-ui/src/IconButton/IconButton.test.js index f03f00e1c2d449..c33f6656806cb6 100644 --- a/packages/material-ui/src/IconButton/IconButton.test.js +++ b/packages/material-ui/src/IconButton/IconButton.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import PropTypes from 'prop-types'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Icon from '../Icon'; import ButtonBase from '../ButtonBase'; import IconButton from './IconButton'; diff --git a/packages/material-ui/src/Input/Input.d.ts b/packages/material-ui/src/Input/Input.d.ts index ef2269ce42a5ee..21dae1565a3f9d 100644 --- a/packages/material-ui/src/Input/Input.d.ts +++ b/packages/material-ui/src/Input/Input.d.ts @@ -1,4 +1,3 @@ -import * as React from 'react'; import { StandardProps } from '..'; import { InputBaseProps } from '../InputBase'; diff --git a/packages/material-ui/src/InputAdornment/InputAdornment.test.js b/packages/material-ui/src/InputAdornment/InputAdornment.test.js index 9a6ac9ea565313..f905346dedf9c4 100644 --- a/packages/material-ui/src/InputAdornment/InputAdornment.test.js +++ b/packages/material-ui/src/InputAdornment/InputAdornment.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Typography from '../Typography'; import InputAdornment from './InputAdornment'; import TextField from '../TextField'; diff --git a/packages/material-ui/src/InputBase/InputBase.test.js b/packages/material-ui/src/InputBase/InputBase.test.js index 36ab7a09f9aab9..0e214cddbdb476 100644 --- a/packages/material-ui/src/InputBase/InputBase.test.js +++ b/packages/material-ui/src/InputBase/InputBase.test.js @@ -4,8 +4,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl, { useFormControl } from '../FormControl'; import InputAdornment from '../InputAdornment'; import TextareaAutosize from '../TextareaAutosize'; diff --git a/packages/material-ui/src/InputLabel/InputLabel.test.js b/packages/material-ui/src/InputLabel/InputLabel.test.js index 168001d1aeb64f..33d77d6efa35ab 100644 --- a/packages/material-ui/src/InputLabel/InputLabel.test.js +++ b/packages/material-ui/src/InputLabel/InputLabel.test.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl from '../FormControl'; import Input from '../Input'; import InputLabel from './InputLabel'; diff --git a/packages/material-ui/src/Link/Link.d.ts b/packages/material-ui/src/Link/Link.d.ts index 2800915e13019a..bf4512947a0a2e 100644 --- a/packages/material-ui/src/Link/Link.d.ts +++ b/packages/material-ui/src/Link/Link.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { Omit } from '@material-ui/types'; +import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TypographyProps } from '../Typography'; export interface LinkTypeMap { diff --git a/packages/material-ui/src/Link/Link.js b/packages/material-ui/src/Link/Link.js index b095602655175b..9dc14fc342768e 100644 --- a/packages/material-ui/src/Link/Link.js +++ b/packages/material-ui/src/Link/Link.js @@ -1,9 +1,9 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; +import { elementTypeAcceptingRef } from '@material-ui/utils'; import capitalize from '../utils/capitalize'; import withStyles from '../styles/withStyles'; -import { elementTypeAcceptingRef } from '@material-ui/utils'; import useIsFocusVisible from '../utils/useIsFocusVisible'; import useForkRef from '../utils/useForkRef'; import Typography from '../Typography'; diff --git a/packages/material-ui/src/ListItem/ListItem.js b/packages/material-ui/src/ListItem/ListItem.js index 39d1e2c72aae1e..1f319c543c77b3 100644 --- a/packages/material-ui/src/ListItem/ListItem.js +++ b/packages/material-ui/src/ListItem/ListItem.js @@ -1,4 +1,5 @@ import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { chainPropTypes } from '@material-ui/utils'; @@ -7,7 +8,6 @@ import ButtonBase from '../ButtonBase'; import isMuiElement from '../utils/isMuiElement'; import useForkRef from '../utils/useForkRef'; import ListContext from '../List/ListContext'; -import * as ReactDOM from 'react-dom'; export const styles = (theme) => ({ /* Styles applied to the (normally root) `component` element. May be wrapped by a `container`. */ diff --git a/packages/material-ui/src/ListItem/ListItem.test.js b/packages/material-ui/src/ListItem/ListItem.test.js index 25de891e7ddcfb..f3be77faf3c064 100644 --- a/packages/material-ui/src/ListItem/ListItem.test.js +++ b/packages/material-ui/src/ListItem/ListItem.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import PropTypes from 'prop-types'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent, queries, screen } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import ListItemText from '../ListItemText'; import ListItemSecondaryAction from '../ListItemSecondaryAction'; import ListItem from './ListItem'; diff --git a/packages/material-ui/src/ListSubheader/ListSubheader.d.ts b/packages/material-ui/src/ListSubheader/ListSubheader.d.ts index a896fbcdfc11fb..126855bd0653bf 100644 --- a/packages/material-ui/src/ListSubheader/ListSubheader.d.ts +++ b/packages/material-ui/src/ListSubheader/ListSubheader.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { StandardProps } from '..'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; export interface ListSubheaderTypeMap { diff --git a/packages/material-ui/src/Menu/Menu.d.ts b/packages/material-ui/src/Menu/Menu.d.ts index e84e379ee45130..df62c39be1c159 100644 --- a/packages/material-ui/src/Menu/Menu.d.ts +++ b/packages/material-ui/src/Menu/Menu.d.ts @@ -1,7 +1,6 @@ import * as React from 'react'; import { PopoverProps } from '../Popover'; import { MenuListProps } from '../MenuList'; -import { PaperProps } from '../Paper'; import { StandardProps } from '..'; import { TransitionHandlerProps, TransitionProps } from '../transitions/transition'; diff --git a/packages/material-ui/src/Menu/Menu.js b/packages/material-ui/src/Menu/Menu.js index deae57fb09f20d..08abb78b8db7a1 100644 --- a/packages/material-ui/src/Menu/Menu.js +++ b/packages/material-ui/src/Menu/Menu.js @@ -1,4 +1,5 @@ import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import { isFragment } from 'react-is'; import PropTypes from 'prop-types'; import clsx from 'clsx'; @@ -6,7 +7,6 @@ import { HTMLElementType } from '@material-ui/utils'; import withStyles from '../styles/withStyles'; import Popover from '../Popover'; import MenuList from '../MenuList'; -import * as ReactDOM from 'react-dom'; import setRef from '../utils/setRef'; import useTheme from '../styles/useTheme'; diff --git a/packages/material-ui/src/MenuItem/MenuItem.d.ts b/packages/material-ui/src/MenuItem/MenuItem.d.ts index ab44e0f48d820b..750d2f3263c725 100644 --- a/packages/material-ui/src/MenuItem/MenuItem.d.ts +++ b/packages/material-ui/src/MenuItem/MenuItem.d.ts @@ -1,7 +1,7 @@ +import { Omit } from '@material-ui/types'; import { ListItemTypeMap, ListItemProps } from '../ListItem'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ExtendButtonBase } from '../ButtonBase'; -import { Omit } from '@material-ui/types'; export type MenuItemClassKey = 'root' | 'gutters' | 'selected' | 'dense'; diff --git a/packages/material-ui/src/Modal/Modal.d.ts b/packages/material-ui/src/Modal/Modal.d.ts index 00fb27885619fa..7ee24693098d76 100644 --- a/packages/material-ui/src/Modal/Modal.d.ts +++ b/packages/material-ui/src/Modal/Modal.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StandardProps, ModalManager } from '..'; +import { StandardProps } from '..'; import { BackdropProps } from '../Backdrop'; import { PortalProps } from '../Portal'; diff --git a/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js b/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js index dae353bff0cdc8..f85fb34d38916f 100644 --- a/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js +++ b/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import OutlinedInput from './OutlinedInput'; import InputBase from '../InputBase'; diff --git a/packages/material-ui/src/Popover/Popover.js b/packages/material-ui/src/Popover/Popover.js index d123bd4f501506..115e67444d27f2 100644 --- a/packages/material-ui/src/Popover/Popover.js +++ b/packages/material-ui/src/Popover/Popover.js @@ -7,8 +7,8 @@ import { refType, HTMLElementType, } from '@material-ui/utils'; -import debounce from '../utils/debounce'; import clsx from 'clsx'; +import debounce from '../utils/debounce'; import ownerDocument from '../utils/ownerDocument'; import ownerWindow from '../utils/ownerWindow'; import createChainedFunction from '../utils/createChainedFunction'; diff --git a/packages/material-ui/src/RadioGroup/RadioGroup.test.js b/packages/material-ui/src/RadioGroup/RadioGroup.test.js index 28f34d56fc2db2..6d2785aa0c0e22 100644 --- a/packages/material-ui/src/RadioGroup/RadioGroup.test.js +++ b/packages/material-ui/src/RadioGroup/RadioGroup.test.js @@ -4,8 +4,8 @@ import { spy } from 'sinon'; import * as PropTypes from 'prop-types'; import { findOutermostIntrinsic } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormGroup from '../FormGroup'; import Radio from '../Radio'; import RadioGroup from './RadioGroup'; diff --git a/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts b/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts index ae3fa093db4b42..f4eb93c9c18113 100644 --- a/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts +++ b/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts @@ -1,4 +1,3 @@ -import { Context } from 'react'; import { RadioGroupProps } from './RadioGroup'; export interface RadioGroupState extends Pick {} diff --git a/packages/material-ui/src/Select/Select.test.js b/packages/material-ui/src/Select/Select.test.js index 669dd7da941b7b..12b558c4352cb8 100644 --- a/packages/material-ui/src/Select/Select.test.js +++ b/packages/material-ui/src/Select/Select.test.js @@ -1,5 +1,6 @@ import * as React from 'react'; import { expect } from 'chai'; +import { spy, stub, useFakeTimers } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; @@ -9,7 +10,6 @@ import MenuItem from '../MenuItem'; import Input from '../Input'; import InputLabel from '../InputLabel'; import Select from './Select'; -import { spy, stub, useFakeTimers } from 'sinon'; describe('', () => { let classes; diff --git a/packages/material-ui/src/Select/SelectInput.js b/packages/material-ui/src/Select/SelectInput.js index 27446e29a57061..bb4b0f97de6790 100644 --- a/packages/material-ui/src/Select/SelectInput.js +++ b/packages/material-ui/src/Select/SelectInput.js @@ -3,9 +3,9 @@ import { isFragment } from 'react-is'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import MuiError from '@material-ui/utils/macros/MuiError.macro'; +import { refType } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import capitalize from '../utils/capitalize'; -import { refType } from '@material-ui/utils'; import Menu from '../Menu/Menu'; import { isFilled } from '../InputBase/utils'; import useForkRef from '../utils/useForkRef'; diff --git a/packages/material-ui/src/Slide/Slide.d.ts b/packages/material-ui/src/Slide/Slide.d.ts index 1f25d0931037b8..fddc05aa073417 100644 --- a/packages/material-ui/src/Slide/Slide.d.ts +++ b/packages/material-ui/src/Slide/Slide.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface SlideProps extends TransitionProps { diff --git a/packages/material-ui/src/Slide/Slide.js b/packages/material-ui/src/Slide/Slide.js index 05bf9eb0ec5a83..02d1186c017c54 100644 --- a/packages/material-ui/src/Slide/Slide.js +++ b/packages/material-ui/src/Slide/Slide.js @@ -1,9 +1,9 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import * as ReactDOM from 'react-dom'; -import debounce from '../utils/debounce'; import { Transition } from 'react-transition-group'; import { elementAcceptingRef } from '@material-ui/utils'; +import debounce from '../utils/debounce'; import useForkRef from '../utils/useForkRef'; import useTheme from '../styles/useTheme'; import { duration } from '../styles/transitions'; diff --git a/packages/material-ui/src/Slide/Slide.test.js b/packages/material-ui/src/Slide/Slide.test.js index 15b18a2fc3d342..364889730fdc75 100644 --- a/packages/material-ui/src/Slide/Slide.test.js +++ b/packages/material-ui/src/Slide/Slide.test.js @@ -3,13 +3,13 @@ import { expect } from 'chai'; import { spy, stub, useFakeTimers } from 'sinon'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; -import Slide, { setTranslateValue } from './Slide'; import { createMuiTheme, ThemeProvider, unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, } from '@material-ui/core/styles'; import { Transition } from 'react-transition-group'; +import Slide, { setTranslateValue } from './Slide'; import { useForkRef } from '../utils'; describe('', () => { diff --git a/packages/material-ui/src/Step/Step.d.ts b/packages/material-ui/src/Step/Step.d.ts index 40e75292b1e5bf..e89f479a78de77 100644 --- a/packages/material-ui/src/Step/Step.d.ts +++ b/packages/material-ui/src/Step/Step.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { StandardProps } from '..'; -import { Orientation } from '../Stepper'; export interface StepProps extends StandardProps, StepClasskey> { diff --git a/packages/material-ui/src/Step/Step.test.js b/packages/material-ui/src/Step/Step.test.js index 23d05ef7fd8d90..143927893efe15 100644 --- a/packages/material-ui/src/Step/Step.test.js +++ b/packages/material-ui/src/Step/Step.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Step from './Step'; import Stepper from '../Stepper'; import StepLabel from '../StepLabel'; diff --git a/packages/material-ui/src/StepButton/StepButton.d.ts b/packages/material-ui/src/StepButton/StepButton.d.ts index 266f0834d01b3c..54f4673dd925ea 100644 --- a/packages/material-ui/src/StepButton/StepButton.d.ts +++ b/packages/material-ui/src/StepButton/StepButton.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Orientation } from '../Stepper'; import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; diff --git a/packages/material-ui/src/StepButton/StepButton.test.js b/packages/material-ui/src/StepButton/StepButton.test.js index ff9aa661aea8f3..a1f5a5880dfa2f 100644 --- a/packages/material-ui/src/StepButton/StepButton.test.js +++ b/packages/material-ui/src/StepButton/StepButton.test.js @@ -3,13 +3,13 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import { fireEvent } from '@testing-library/dom'; +import describeConformance from '../test-utils/describeConformance'; import StepButton from './StepButton'; import Step from '../Step'; import StepLabel from '../StepLabel'; import ButtonBase from '../ButtonBase'; -import { fireEvent } from '@testing-library/dom'; describe('', () => { let classes; diff --git a/packages/material-ui/src/StepContent/StepContent.d.ts b/packages/material-ui/src/StepContent/StepContent.d.ts index 596eeb5bf262c5..1b956ab7118cd4 100644 --- a/packages/material-ui/src/StepContent/StepContent.d.ts +++ b/packages/material-ui/src/StepContent/StepContent.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { StandardProps } from '..'; -import { Orientation } from '../Stepper'; import { TransitionProps } from '../transitions/transition'; export interface StepContentProps diff --git a/packages/material-ui/src/Stepper/Stepper.test.js b/packages/material-ui/src/Stepper/Stepper.test.js index 229848f518550f..73071719741384 100644 --- a/packages/material-ui/src/Stepper/Stepper.test.js +++ b/packages/material-ui/src/Stepper/Stepper.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Paper from '../Paper'; import Step from '../Step'; import StepLabel from '../StepLabel'; diff --git a/packages/material-ui/src/Switch/Switch.test.js b/packages/material-ui/src/Switch/Switch.test.js index 3e6b57a69006ad..0e663f2d5ad10f 100644 --- a/packages/material-ui/src/Switch/Switch.test.js +++ b/packages/material-ui/src/Switch/Switch.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl from '../FormControl'; import Switch from './Switch'; diff --git a/packages/material-ui/src/Tab/Tab.test.js b/packages/material-ui/src/Tab/Tab.test.js index afb365bc0e0145..f54d96814e5f42 100644 --- a/packages/material-ui/src/Tab/Tab.test.js +++ b/packages/material-ui/src/Tab/Tab.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Tab from './Tab'; import ButtonBase from '../ButtonBase'; diff --git a/packages/material-ui/src/Table/Table.test.js b/packages/material-ui/src/Table/Table.test.js index cc9af272d8cad5..d01cceefed7935 100644 --- a/packages/material-ui/src/Table/Table.test.js +++ b/packages/material-ui/src/Table/Table.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Table from './Table'; import TableContext from './TableContext'; diff --git a/packages/material-ui/src/TableBody/TableBody.test.js b/packages/material-ui/src/TableBody/TableBody.test.js index ef929c17c46452..511a8b84c13e4e 100644 --- a/packages/material-ui/src/TableBody/TableBody.test.js +++ b/packages/material-ui/src/TableBody/TableBody.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableBody from './TableBody'; import Tablelvl2Context from '../Table/Tablelvl2Context'; diff --git a/packages/material-ui/src/TableFooter/TableFooter.test.js b/packages/material-ui/src/TableFooter/TableFooter.test.js index bc3feab52c61e8..03fd191a41e2c9 100644 --- a/packages/material-ui/src/TableFooter/TableFooter.test.js +++ b/packages/material-ui/src/TableFooter/TableFooter.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableFooter from './TableFooter'; import Tablelvl2Context from '../Table/Tablelvl2Context'; diff --git a/packages/material-ui/src/TableHead/TableHead.test.js b/packages/material-ui/src/TableHead/TableHead.test.js index 9c047fcb191a7f..5498999120c7bc 100644 --- a/packages/material-ui/src/TableHead/TableHead.test.js +++ b/packages/material-ui/src/TableHead/TableHead.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableHead from './TableHead'; import Tablelvl2Context from '../Table/Tablelvl2Context'; diff --git a/packages/material-ui/src/TablePagination/TablePagination.d.ts b/packages/material-ui/src/TablePagination/TablePagination.d.ts index 4fbdab95b7dfd6..b192123b31f4b1 100644 --- a/packages/material-ui/src/TablePagination/TablePagination.d.ts +++ b/packages/material-ui/src/TablePagination/TablePagination.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { Omit } from '@material-ui/types'; +import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TablePaginationActionsProps } from './TablePaginationActions'; import { TableCellProps } from '../TableCell'; import { IconButtonProps } from '../IconButton'; diff --git a/packages/material-ui/src/TableRow/TableRow.test.js b/packages/material-ui/src/TableRow/TableRow.test.js index 88218e6df43b99..4380f9a98b0af2 100644 --- a/packages/material-ui/src/TableRow/TableRow.test.js +++ b/packages/material-ui/src/TableRow/TableRow.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableRow from './TableRow'; describe('', () => { diff --git a/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts b/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts index b61c24e936ad4d..b8680d9fa15ce6 100644 --- a/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts +++ b/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; -import { SvgIconProps } from '../SvgIcon'; import { OverrideProps } from '../OverridableComponent'; export type TableSortLabelTypeMap< diff --git a/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js b/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js index b935958380f94b..b2ea91a66c0b34 100644 --- a/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js +++ b/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js @@ -3,10 +3,10 @@ import { expect } from 'chai'; import { createClientRender } from 'test/utils/createClientRender'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; +import Sort from '@material-ui/icons/Sort'; import describeConformance from '../test-utils/describeConformance'; import TableSortLabel from './TableSortLabel'; import ButtonBase from '../ButtonBase'; -import Sort from '@material-ui/icons/Sort'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui/src/Tabs/ScrollbarSize.test.js b/packages/material-ui/src/Tabs/ScrollbarSize.test.js index 232b1e4d580b83..7ea3f5deef5960 100644 --- a/packages/material-ui/src/Tabs/ScrollbarSize.test.js +++ b/packages/material-ui/src/Tabs/ScrollbarSize.test.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { spy, useFakeTimers, stub } from 'sinon'; -import ScrollbarSize from './ScrollbarSize'; import { createClientRender } from 'test/utils/createClientRender'; +import ScrollbarSize from './ScrollbarSize'; describe('', () => { let clock; diff --git a/packages/material-ui/src/Tabs/Tabs.js b/packages/material-ui/src/Tabs/Tabs.js index b37ea86c69bd7f..7e75fda39c7718 100644 --- a/packages/material-ui/src/Tabs/Tabs.js +++ b/packages/material-ui/src/Tabs/Tabs.js @@ -197,6 +197,8 @@ const Tabs = React.forwardRef(function Tabs(props, ref) { [size]: tabMeta ? tabMeta[size] : 0, }; + // IE 11 support, replace with Number.isNaN + // eslint-disable-next-line no-restricted-globals if (isNaN(indicatorStyle[start]) || isNaN(indicatorStyle[size])) { setIndicatorStyle(newIndicatorStyle); } else { diff --git a/packages/material-ui/src/TextField/TextField.test.js b/packages/material-ui/src/TextField/TextField.test.js index 2455634be3aef2..d5d239ed94250e 100644 --- a/packages/material-ui/src/TextField/TextField.test.js +++ b/packages/material-ui/src/TextField/TextField.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl from '../FormControl'; import Input from '../Input'; import OutlinedInput from '../OutlinedInput'; diff --git a/packages/material-ui/src/Toolbar/Toolbar.test.js b/packages/material-ui/src/Toolbar/Toolbar.test.js index 0d00f02fbddcee..72f7b61b88b4e7 100644 --- a/packages/material-ui/src/Toolbar/Toolbar.test.js +++ b/packages/material-ui/src/Toolbar/Toolbar.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Toolbar from './Toolbar'; describe('', () => { diff --git a/packages/material-ui/src/Tooltip/Tooltip.test.js b/packages/material-ui/src/Tooltip/Tooltip.test.js index 3787507c56f438..fb7c772e7a2a84 100644 --- a/packages/material-ui/src/Tooltip/Tooltip.test.js +++ b/packages/material-ui/src/Tooltip/Tooltip.test.js @@ -3,11 +3,11 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; +import { camelCase } from 'lodash/string'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; import describeConformance from '../test-utils/describeConformance'; import Tooltip, { testReset } from './Tooltip'; import Input from '../Input'; -import { camelCase } from 'lodash/string'; function focusVisible(element) { act(() => { diff --git a/packages/material-ui/src/Typography/Typography.d.ts b/packages/material-ui/src/Typography/Typography.d.ts index 3d71c929242923..c965102f68324b 100644 --- a/packages/material-ui/src/Typography/Typography.d.ts +++ b/packages/material-ui/src/Typography/Typography.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { StandardProps, PropTypes } from '..'; -import { OverrideProps, OverridableTypeMap, OverridableComponent } from '../OverridableComponent'; +import { PropTypes } from '..'; +import { OverrideProps, OverridableComponent } from '../OverridableComponent'; import { Variant } from '../styles/createTypography'; export interface TypographyTypeMap { diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts index 6a29f198d9b44f..f2413e553a356d 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import * as React from 'react'; export interface TrapFocusProps { diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js index 97fac726d1169e..6d33026259c8c6 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js @@ -1,10 +1,10 @@ -/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex, camelcase */ +/* eslint-disable @typescript-eslint/naming-convention, consistent-return, jsx-a11y/no-noninteractive-tabindex */ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; +import { exactProp } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import useForkRef from '../utils/useForkRef'; -import { exactProp } from '@material-ui/utils'; /** * Utility component that locks focus inside the component. diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js index 087bb43fbc7fae..5bc05483297738 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { useFakeTimers } from 'sinon'; import { expect } from 'chai'; -import TrapFocus from './Unstable_TrapFocus'; import { createClientRender, fireEvent, screen } from 'test/utils/createClientRender'; +import TrapFocus from './Unstable_TrapFocus'; import Portal from '../Portal'; describe('', () => { diff --git a/packages/material-ui/src/Zoom/Zoom.d.ts b/packages/material-ui/src/Zoom/Zoom.d.ts index ca1a5e1d5ce279..09b89ac4c3032d 100644 --- a/packages/material-ui/src/Zoom/Zoom.d.ts +++ b/packages/material-ui/src/Zoom/Zoom.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface ZoomProps extends TransitionProps { diff --git a/packages/material-ui/src/Zoom/Zoom.test.js b/packages/material-ui/src/Zoom/Zoom.test.js index edb4e95f8ee2b0..f06cb73bd92c8d 100644 --- a/packages/material-ui/src/Zoom/Zoom.test.js +++ b/packages/material-ui/src/Zoom/Zoom.test.js @@ -3,11 +3,11 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; +import { Transition } from 'react-transition-group'; import { unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, ThemeProvider, } from '../styles'; -import { Transition } from 'react-transition-group'; import Zoom from './Zoom'; describe('', () => { diff --git a/packages/material-ui/src/index.d.ts b/packages/material-ui/src/index.d.ts index d43649def02d15..a3a8c91cb8be64 100644 --- a/packages/material-ui/src/index.d.ts +++ b/packages/material-ui/src/index.d.ts @@ -1,6 +1,7 @@ import * as React from 'react'; import { Omit } from '@material-ui/types'; import { StyledComponentProps } from './styles'; + export { StyledComponentProps }; /** @@ -51,6 +52,7 @@ export namespace PropTypes { } // From index.js +// eslint-disable-next-line import/first import * as colors from './colors'; export { colors }; diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js index 55f554af478a7c..f7fb087b59eae6 100644 --- a/packages/material-ui/src/index.js +++ b/packages/material-ui/src/index.js @@ -339,7 +339,6 @@ export * from './Tooltip'; export { default as Typography } from './Typography'; export * from './Typography'; -// eslint-disable-next-line camelcase export { default as Unstable_TrapFocus } from './Unstable_TrapFocus'; export * from './Unstable_TrapFocus'; diff --git a/packages/material-ui/src/internal/SwitchBase.test.js b/packages/material-ui/src/internal/SwitchBase.test.js index b09d42611ebffb..79664390d0fe18 100644 --- a/packages/material-ui/src/internal/SwitchBase.test.js +++ b/packages/material-ui/src/internal/SwitchBase.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import SwitchBase from './SwitchBase'; import FormControl, { useFormControl } from '../FormControl'; import IconButton from '../IconButton'; diff --git a/packages/material-ui/src/styles/colorManipulator.js b/packages/material-ui/src/styles/colorManipulator.js index e228e9ca01be6a..5b9e874efe1858 100644 --- a/packages/material-ui/src/styles/colorManipulator.js +++ b/packages/material-ui/src/styles/colorManipulator.js @@ -1,5 +1,5 @@ import MuiError from '@material-ui/utils/macros/MuiError.macro'; -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ /** * Returns a number whose value is limited to the given range. diff --git a/packages/material-ui/src/styles/createTypography.d.ts b/packages/material-ui/src/styles/createTypography.d.ts index 42243fb6b03155..27edadb55f37b1 100644 --- a/packages/material-ui/src/styles/createTypography.d.ts +++ b/packages/material-ui/src/styles/createTypography.d.ts @@ -1,5 +1,5 @@ -import { Palette } from './createPalette'; import * as React from 'react'; +import { Palette } from './createPalette'; import { CSSProperties } from './withStyles'; export type Variant = diff --git a/packages/material-ui/src/styles/index.js b/packages/material-ui/src/styles/index.js index 4b20b716f13994..53625e9e785c29 100644 --- a/packages/material-ui/src/styles/index.js +++ b/packages/material-ui/src/styles/index.js @@ -1,6 +1,5 @@ export * from './colorManipulator'; export { default as createMuiTheme } from './createMuiTheme'; -// eslint-disable-next-line camelcase export { default as unstable_createMuiStrictModeTheme } from './createMuiStrictModeTheme'; export { default as createStyles } from './createStyles'; export { default as makeStyles } from './makeStyles'; diff --git a/packages/material-ui/src/styles/makeStyles.d.ts b/packages/material-ui/src/styles/makeStyles.d.ts index 0581923403e100..07908af194078f 100644 --- a/packages/material-ui/src/styles/makeStyles.d.ts +++ b/packages/material-ui/src/styles/makeStyles.d.ts @@ -1,7 +1,6 @@ -import { Theme as DefaultTheme } from './createMuiTheme'; import { ClassNameMap, Styles, WithStylesOptions } from '@material-ui/styles/withStyles'; - import { Omit } from '@material-ui/types'; +import { Theme as DefaultTheme } from './createMuiTheme'; /** * `makeStyles` where the passed `styles` do not depend on props diff --git a/packages/material-ui/src/styles/responsiveFontSizes.test.js b/packages/material-ui/src/styles/responsiveFontSizes.test.js index 2221406cb38fb6..bd9d7e4d7cfaeb 100644 --- a/packages/material-ui/src/styles/responsiveFontSizes.test.js +++ b/packages/material-ui/src/styles/responsiveFontSizes.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import responsiveFontSizes from './responsiveFontSizes'; import { createMuiTheme } from '@material-ui/core/styles'; +import responsiveFontSizes from './responsiveFontSizes'; describe('responsiveFontSizes', () => { it('should support unitless line height', () => { diff --git a/packages/material-ui/src/styles/styled.d.ts b/packages/material-ui/src/styles/styled.d.ts index 0414fde1bfd65c..6ed2805893d232 100644 --- a/packages/material-ui/src/styles/styled.d.ts +++ b/packages/material-ui/src/styles/styled.d.ts @@ -1,3 +1,4 @@ +import * as React from 'react'; import { Omit } from '@material-ui/types'; import { CreateCSSProperties, @@ -5,7 +6,6 @@ import { WithStylesOptions, } from '@material-ui/styles/withStyles'; import { Theme as DefaultTheme } from './createMuiTheme'; -import * as React from 'react'; // These definitions are almost identical to the ones in @material-ui/styles/styled // Only difference is that ComponentCreator has a default theme type diff --git a/packages/material-ui/src/styles/transitions.js b/packages/material-ui/src/styles/transitions.js index 6012d67fbd8bd3..a127a1c0c55326 100644 --- a/packages/material-ui/src/styles/transitions.js +++ b/packages/material-ui/src/styles/transitions.js @@ -53,6 +53,8 @@ export default { if (process.env.NODE_ENV !== 'production') { const isString = (value) => typeof value === 'string'; + // IE 11 support, replace with Number.isNaN + // eslint-disable-next-line no-restricted-globals const isNumber = (value) => !isNaN(parseFloat(value)); if (!isString(props) && !Array.isArray(props)) { console.error('Material-UI: Argument "props" must be a string or Array.'); diff --git a/packages/material-ui/src/styles/transitions.test.js b/packages/material-ui/src/styles/transitions.test.js index 6d537db1bfa80f..665ba3c847b8ce 100644 --- a/packages/material-ui/src/styles/transitions.test.js +++ b/packages/material-ui/src/styles/transitions.test.js @@ -138,10 +138,13 @@ describe('transitions', () => { it('should return NaN when passed a negative number', () => { const zeroHeightDurationNegativeOne = transitions.getAutoHeightDuration(-1); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationNegativeOne)).to.equal(true); const zeroHeightDurationSmallNegative = transitions.getAutoHeightDuration(-0.000001); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationSmallNegative)).to.equal(true); const zeroHeightDurationBigNegative = transitions.getAutoHeightDuration(-100000); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationBigNegative)).to.equal(true); }); diff --git a/packages/material-ui/src/styles/withStyles.d.ts b/packages/material-ui/src/styles/withStyles.d.ts index 6b0b2ed5879eae..6b68913f544c09 100644 --- a/packages/material-ui/src/styles/withStyles.d.ts +++ b/packages/material-ui/src/styles/withStyles.d.ts @@ -1,5 +1,4 @@ import { PropInjector } from '@material-ui/types'; -import { Theme } from './createMuiTheme'; import { CreateCSSProperties, CSSProperties, @@ -12,6 +11,7 @@ import { ClassKeyOfStyles, BaseCSSProperties, } from '@material-ui/styles/withStyles'; +import { Theme } from './createMuiTheme'; export { CreateCSSProperties, diff --git a/packages/material-ui/src/styles/withTheme.d.ts b/packages/material-ui/src/styles/withTheme.d.ts index 70025c9a048c54..8d07025e82ca75 100644 --- a/packages/material-ui/src/styles/withTheme.d.ts +++ b/packages/material-ui/src/styles/withTheme.d.ts @@ -1,5 +1,5 @@ -import { Theme } from './createMuiTheme'; import { PropInjector } from '@material-ui/types'; +import { Theme } from './createMuiTheme'; export interface WithTheme { theme: Theme; diff --git a/packages/material-ui/src/test-utils/createMount.js b/packages/material-ui/src/test-utils/createMount.js index ca52bd6bec0cdf..6fe43e024cfaf0 100644 --- a/packages/material-ui/src/test-utils/createMount.js +++ b/packages/material-ui/src/test-utils/createMount.js @@ -24,6 +24,7 @@ class Mode extends React.Component { render() { // Excess props will come from e.g. enzyme setProps + // eslint-disable-next-line @typescript-eslint/naming-convention const { __element, __strict, ...other } = this.props; const Component = __strict ? React.StrictMode : React.Fragment; diff --git a/packages/material-ui/src/test-utils/describeConformance.js b/packages/material-ui/src/test-utils/describeConformance.js index e60a1cca092b7b..1b88b58a8bf36e 100644 --- a/packages/material-ui/src/test-utils/describeConformance.js +++ b/packages/material-ui/src/test-utils/describeConformance.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as React from 'react'; -import findOutermostIntrinsic from './findOutermostIntrinsic'; import ReactTestRenderer from 'react-test-renderer'; +import findOutermostIntrinsic from './findOutermostIntrinsic'; import testRef from './testRef'; /** diff --git a/packages/material-ui/src/utils/index.js b/packages/material-ui/src/utils/index.js index a79c386cfc4104..0c5cddfc7f77ed 100644 --- a/packages/material-ui/src/utils/index.js +++ b/packages/material-ui/src/utils/index.js @@ -12,6 +12,5 @@ export { default as unsupportedProp } from './unsupportedProp'; export { default as useControlled } from './useControlled'; export { default as useEventCallback } from './useEventCallback'; export { default as useForkRef } from './useForkRef'; -// eslint-disable-next-line camelcase export { default as unstable_useId } from './unstable_useId'; export { default as useIsFocusVisible } from './useIsFocusVisible'; diff --git a/packages/material-ui/src/utils/isMuiElement.d.ts b/packages/material-ui/src/utils/isMuiElement.d.ts index bfb5df3b456eef..ffca03d9a690c2 100644 --- a/packages/material-ui/src/utils/isMuiElement.d.ts +++ b/packages/material-ui/src/utils/isMuiElement.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StandardProps } from '../'; +import { StandardProps } from '..'; export type NamedMuiComponent = React.ComponentType & { muiName: string }; diff --git a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts b/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts index fed68f6668aa72..2bbe60bcff0f62 100644 --- a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts +++ b/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts @@ -1,6 +1,6 @@ +import { PropInjector } from '@material-ui/types'; import { Breakpoint } from '../styles/createBreakpoints'; import { WithWidth } from '../withWidth'; -import { PropInjector } from '@material-ui/types'; export interface WithMobileDialogOptions { breakpoint: Breakpoint; diff --git a/packages/material-ui/src/withWidth/withWidth.d.ts b/packages/material-ui/src/withWidth/withWidth.d.ts index 64669acfd1abc0..7d76ce474a7509 100644 --- a/packages/material-ui/src/withWidth/withWidth.d.ts +++ b/packages/material-ui/src/withWidth/withWidth.d.ts @@ -1,5 +1,5 @@ -import { Breakpoint } from '../styles/createBreakpoints'; import { PropInjector } from '@material-ui/types'; +import { Breakpoint } from '../styles/createBreakpoints'; export interface WithWidthOptions { withTheme?: boolean; diff --git a/packages/material-ui/test/typescript/components.spec.tsx b/packages/material-ui/test/typescript/components.spec.tsx index e41a804807a67b..636b042a9df8cb 100644 --- a/packages/material-ui/test/typescript/components.spec.tsx +++ b/packages/material-ui/test/typescript/components.spec.tsx @@ -215,8 +215,7 @@ const CardTest = () => ( adjective well meaning and kindly. - - {'"a benevolent smile"'} + a benevolent smile @@ -233,7 +232,7 @@ const CardMediaTest = () => ( subheader="September 14, 2016" /> - + @@ -252,7 +251,7 @@ const CardMediaTest = () => ( - + Method: @@ -288,7 +287,7 @@ const ChipsTest = () => ( M} label="Clickable Chip" onClick={(e) => log(e)} /> - } label="Deletable Chip" onDelete={(e) => log(e)} /> + } label="Deletable Chip" onDelete={(e) => log(e)} /> @@ -305,7 +304,7 @@ const ChipsTest = () => ( const DialogTest = () => { const emails = ['username@gmail.com', 'user02@gmail.com']; return ( - log(e)} open> + log(event)} open> Set backup account @@ -399,14 +398,19 @@ const DrawerTest = () => { }; return ( - log(e)} onClick={(e) => log(e)}> + log(event)} + onClick={(e) => log(e)} + > List log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} ModalProps={{ hideBackdrop: true, @@ -418,7 +422,7 @@ const DrawerTest = () => { anchor="bottom" variant="temporary" open={open.bottom} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} > List @@ -427,7 +431,7 @@ const DrawerTest = () => { variant="persistent" anchor="right" open={open.right} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} > List @@ -447,7 +451,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -456,7 +460,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} ModalProps={{ @@ -468,7 +472,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -478,7 +482,7 @@ const SwipeableDrawerTest = () => { variant="temporary" anchor="right" open={open.right} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -516,7 +520,7 @@ const GridTest = () => ( ... - + ... @@ -538,7 +542,7 @@ const ListTest = () => ( {[0, 1, 2, 3].map((value) => ( log(e)}> - + @@ -566,8 +570,8 @@ const MenuTest = () => { log(e)} + open + onClose={(event) => log(event)} PopoverClasses={{ paper: 'foo' }} > {options.map((option, index) => ( @@ -691,9 +695,7 @@ const SelectionControlTest = () => { label="Indeterminate" /> - } + control={} label="Custom color" /> @@ -744,9 +746,9 @@ const SnackbarTest = () => ( vertical: 'bottom', horizontal: 'left', }} - open={true} + open autoHideDuration={6000} - onClose={(e) => log(e)} + onClose={(event) => log(event)} ContentProps={ { // 'aria-describedby': 'message-id', @@ -942,9 +944,9 @@ const TabsTest = () => { - {this.state.value === 0 && {'Item One'}} - {this.state.value === 1 && {'Item Two'}} - {this.state.value === 2 && {'Item Three'}} + {this.state.value === 0 && Item One} + {this.state.value === 1 && Item Two} + {this.state.value === 2 && Item Three} ); } @@ -955,15 +957,15 @@ const TabsTest = () => { const TextFieldTest = () => ( - - Name} value={'Alice'} /> + + Name} value="Alice" /> log({ name: event.currentTarget.value })} /> - + ( ); const LinkTest = () => { - const dudUrl = 'javascript:;'; + const dudUrl = 'javascript'; return ( Link - {'color="inherit"'} + inherit - {'variant="body1"'} + body1 ); diff --git a/packages/material-ui/test/typescript/styles.spec.tsx b/packages/material-ui/test/typescript/styles.spec.tsx index 6be0f6dd690aa1..fdc313eaeb1e5b 100644 --- a/packages/material-ui/test/typescript/styles.spec.tsx +++ b/packages/material-ui/test/typescript/styles.spec.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/rules-of-hooks */ import * as React from 'react'; import { createStyles, @@ -164,7 +165,7 @@ const t5 = createMuiTheme().spacing(1, 2, 3, 4, 5); function OverridesTheme() { return ( - {'Overrides'} + Overrides ); } @@ -488,7 +489,7 @@ withStyles((theme) => { // https://github.com/mui-org/material-ui/pull/15546 // Update type definition to let CSS properties be functions - interface testProps { + interface TestProps { foo: boolean; } @@ -496,10 +497,10 @@ withStyles((theme) => { const useStyles = makeStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), }), }); @@ -511,10 +512,10 @@ withStyles((theme) => { const useStyles = makeStyles((theme) => ({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), margin: theme.spacing(1), }), })); @@ -527,10 +528,10 @@ withStyles((theme) => { const styles = createStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), }), }); @@ -542,10 +543,10 @@ withStyles((theme) => { withStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), margin: 8, }), }); @@ -555,10 +556,10 @@ withStyles((theme) => { withStyles((theme) => ({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), height: theme.spacing(1), }), })); @@ -618,18 +619,18 @@ withStyles((theme) => return { padding: theme.spacing(1) }; }); - interface myProps { + interface MyProps { testValue: boolean; } // Type of props follow all the way to css properties - styled(Button)(({ theme, testValue }) => { + styled(Button)(({ theme, testValue }) => { expectType(theme); expectType(testValue); return { padding: (props) => { - expectType(props); + expectType(props); expectType(props.testValue); return theme.spacing(1); diff --git a/packages/typescript-to-proptypes/test/options-test/options.ts b/packages/typescript-to-proptypes/test/options-test/options.ts index 85f340a76c7db1..0d76f3064bb9b8 100644 --- a/packages/typescript-to-proptypes/test/options-test/options.ts +++ b/packages/typescript-to-proptypes/test/options-test/options.ts @@ -6,6 +6,7 @@ const options: TestOptions = { if (name.endsWith('Props')) { return false; } + return true; }, }, injector: { diff --git a/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts b/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts index 5e9d3028d4404d..d9fddc0e5f9303 100644 --- a/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts +++ b/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + interface ButtonProps { variant?: string; } diff --git a/packages/typescript-to-proptypes/test/sort-unions/input.d.ts b/packages/typescript-to-proptypes/test/sort-unions/input.d.ts index 08d90791df5a95..5379600ee91549 100644 --- a/packages/typescript-to-proptypes/test/sort-unions/input.d.ts +++ b/packages/typescript-to-proptypes/test/sort-unions/input.d.ts @@ -1,5 +1,3 @@ -import * as React from 'react'; - type Breakpoint = 'xs' | 'md' | 'xl'; export interface Props { diff --git a/packages/typescript-to-proptypes/test/union-props/input.d.ts b/packages/typescript-to-proptypes/test/union-props/input.d.ts index a4b6a03347078d..551c9bcf1002ff 100644 --- a/packages/typescript-to-proptypes/test/union-props/input.d.ts +++ b/packages/typescript-to-proptypes/test/union-props/input.d.ts @@ -1,5 +1,3 @@ -import * as React from 'react'; - export interface BaseProps { value?: unknown; } diff --git a/scripts/generateProptypes.ts b/scripts/generateProptypes.ts index 37a4728700deae..e4033148770ada 100644 --- a/scripts/generateProptypes.ts +++ b/scripts/generateProptypes.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import * as path from 'path'; import * as fse from 'fs-extra'; import * as ttp from 'typescript-to-proptypes'; @@ -139,6 +140,8 @@ const getSortLiteralUnions: ttp.InjectOptions['getSortLiteralUnions'] = (compone ) { return sortBreakpointsLiteralByViewportAscending; } + + return undefined; }; const tsconfig = ttp.loadConfig(path.resolve(__dirname, '../tsconfig.json')); diff --git a/scripts/listChangedFiles.test.js b/scripts/listChangedFiles.test.js index 24a18d0240856e..5c1360a6e61fdb 100644 --- a/scripts/listChangedFiles.test.js +++ b/scripts/listChangedFiles.test.js @@ -1,8 +1,8 @@ -const listChangedFiles = require('./listChangedFiles'); const fs = require('fs'); const rimraf = require('rimraf'); const { promisify } = require('util'); const { expect } = require('chai'); +const listChangedFiles = require('./listChangedFiles'); const writeFileAsync = promisify(fs.writeFile); const rimrafAsync = promisify(rimraf); diff --git a/test/utils/components.js b/test/utils/components.js index c4ac86bb5590cb..76c47c494ed24a 100644 --- a/test/utils/components.js +++ b/test/utils/components.js @@ -13,7 +13,9 @@ export class ErrorBoundary extends React.Component { children: PropTypes.node.isRequired, }; - state = { error: null }; + state = { + error: null, + }; /** * @public diff --git a/test/utils/createMount.js b/test/utils/createMount.js index 1f9b00453a0f08..fcde56928f558f 100644 --- a/test/utils/createMount.js +++ b/test/utils/createMount.js @@ -28,6 +28,7 @@ class Mode extends React.Component { render() { // Excess props will come from e.g. enzyme setProps + // eslint-disable-next-line @typescript-eslint/naming-convention const { __element, __strict, ...other } = this.props; const Component = __strict ? React.StrictMode : React.Fragment; diff --git a/test/utils/initMatchers.js b/test/utils/initMatchers.js index f7e1e848ab9115..a80d7f19895272 100644 --- a/test/utils/initMatchers.js +++ b/test/utils/initMatchers.js @@ -148,7 +148,7 @@ chai.use((chaiAPI, utils) => { * Correct name for `to.be.visible` */ chai.Assertion.addMethod('toBeVisible', function toBeVisible() { - // eslint-disable-next-line no-underscore-dangle, no-unused-expressions + // eslint-disable-next-line no-underscore-dangle, @typescript-eslint/no-unused-expressions new chai.Assertion(this._obj).to.be.visible; }); }); diff --git a/yarn.lock b/yarn.lock index d84660f8a7fb30..cf256dd121a8b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -344,7 +344,7 @@ resolve "^1.13.1" v8flags "^3.1.1" -"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.10.4", "@babel/parser@^7.7.0", "@babel/parser@^7.7.5": +"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.10.4", "@babel/parser@^7.7.5": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.10.4.tgz#9eedf27e1998d87739fb5028a5120557c06a1a64" integrity sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA== @@ -1050,7 +1050,7 @@ "@babel/parser" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/traverse@^7.10.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.4": +"@babel/traverse@^7.10.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.10.4.tgz#e642e5395a3b09cc95c8e74a27432b484b697818" integrity sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q== @@ -1065,7 +1065,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@7.8.3", "@babel/types@7.9.6", "@babel/types@^7.0.0", "@babel/types@^7.10.2", "@babel/types@^7.10.4", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.6.1", "@babel/types@^7.7.0": +"@babel/types@7.8.3", "@babel/types@7.9.6", "@babel/types@^7.0.0", "@babel/types@^7.10.2", "@babel/types@^7.10.4", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.6.1": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.10.4.tgz#369517188352e18219981efd156bfdb199fff1ee" integrity sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg== @@ -2495,6 +2495,11 @@ "@types/cheerio" "*" "@types/react" "*" +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/eslint@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.0.tgz#eb5c5b575237334df24c53195e37b53d66478d7b" @@ -2565,7 +2570,7 @@ "@types/parse5" "*" "@types/tough-cookie" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.4": +"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.4": version "7.0.5" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ== @@ -2822,6 +2827,66 @@ dependencies: "@types/node" "*" +"@typescript-eslint/eslint-plugin@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.0.tgz#ba2b6cae478b8fca3f2e58ff1313e4198eea2d8a" + integrity sha512-ubHlHVt1lsPQB/CZdEov9XuOFhNG9YRC//kuiS1cMQI6Bs1SsqKrEmZnpgRwthGR09/kEDtr9MywlqXyyYd8GA== + dependencies: + "@typescript-eslint/experimental-utils" "3.6.0" + debug "^4.1.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.0.tgz#0138152d66e3e53a6340f606793fb257bf2d76a1" + integrity sha512-4Vdf2hvYMUnTdkCNZu+yYlFtL2v+N2R7JOynIOkFbPjf9o9wQvRwRkzUdWlFd2YiiUwJLbuuLnl5civNg5ykOQ== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/typescript-estree" "3.6.0" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + +"@typescript-eslint/parser@^3.1.0", "@typescript-eslint/parser@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.6.0.tgz#79b5232e1a2d06f1fc745942b690cd87aca7b60e" + integrity sha512-taghDxuLhbDAD1U5Fk8vF+MnR0yiFE9Z3v2/bYScFb0N1I9SK8eKHkdJl1DAD48OGFDMFTeOTX0z7g0W6SYUXw== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "3.6.0" + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/typescript-estree" "3.6.0" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/types@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.6.0.tgz#4bd6eee55d2f9d35a4b36c4804be1880bf68f7bc" + integrity sha512-JwVj74ohUSt0ZPG+LZ7hb95fW8DFOqBuR6gE7qzq55KDI3BepqsCtHfBIoa0+Xi1AI7fq5nCu2VQL8z4eYftqg== + +"@typescript-eslint/typescript-estree@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.0.tgz#9b4cab43f1192b64ff51530815b8919f166ce177" + integrity sha512-G57NDSABHjvob7zVV09ehWyD1K6/YUKjz5+AufObFyjNO4DVmKejj47MHjVHHlZZKgmpJD2yyH9lfCXHrPITFg== + dependencies: + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/visitor-keys" "3.6.0" + debug "^4.1.1" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/visitor-keys@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.0.tgz#44185eb0cc47651034faa95c5e2e8b314ecebb26" + integrity sha512-p1izllL2Ubwunite0ITjubuMQRBGgjdVYwyG7lXPX8GbrA6qF0uwSRz9MnXZaHMxID4948gX0Ez8v9tUDi/KfQ== + dependencies: + eslint-visitor-keys "^1.1.0" + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -3659,18 +3724,6 @@ babel-core@^7.0.0-bridge.0: resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== -babel-eslint@^10.0.3, babel-eslint@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - babel-loader@^8.0.0: version "8.1.0" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.1.0.tgz#c611d5112bd5209abe8b9fa84c3e4da25275f1c3" @@ -6787,7 +6840,7 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" -eslint-config-airbnb-base@^14.2.0: +eslint-config-airbnb-base@^14.1.0, eslint-config-airbnb-base@^14.2.0: version "14.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz#fe89c24b3f9dc8008c9c0d0d88c28f95ed65e9c4" integrity sha512-Snswd5oC6nJaevs3nZoLSTvGJBvzTfnBqOIArkf3cbyTyq9UD79wOk8s+RiL6bhca0p/eRO6veczhf6A/7Jy8Q== @@ -6796,7 +6849,16 @@ eslint-config-airbnb-base@^14.2.0: object.assign "^4.1.0" object.entries "^1.1.2" -eslint-config-airbnb@^18.2.0: +eslint-config-airbnb-typescript@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-8.0.2.tgz#465b17b0b1facdcca4fe23a5426bc27ab7b2b2f2" + integrity sha512-TCOftyCoIogJzzLGSg0Qlxd27qvf+1a3MHyN/PqynTqINS4iFy+SlXy/CrAN+6xkleGMSrvmPbm3pyFEku2+IQ== + dependencies: + "@typescript-eslint/parser" "^3.1.0" + eslint-config-airbnb "^18.1.0" + eslint-config-airbnb-base "^14.1.0" + +eslint-config-airbnb@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.0.tgz#8a82168713effce8fc08e10896a63f1235499dcd" integrity sha512-Fz4JIUKkrhO0du2cg5opdyPKQXOI2MvF8KUvN2710nJMT6jaRUpRE2swrJftAjVGL7T1otLM5ieo5RqS1v9Udg== @@ -6930,7 +6992,7 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^5.1.0: +eslint-scope@^5.0.0, eslint-scope@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w== @@ -6945,7 +7007,7 @@ eslint-utils@^2.0.0: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.2.0: +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -13653,7 +13715,7 @@ regexp.prototype.flags@^1.3.0: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" -regexpp@^3.1.0: +regexpp@^3.0.0, regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== @@ -15716,6 +15778,13 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" +tsutils@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
{ diff --git a/packages/material-ui/src/Link/Link.js b/packages/material-ui/src/Link/Link.js index b095602655175b..9dc14fc342768e 100644 --- a/packages/material-ui/src/Link/Link.js +++ b/packages/material-ui/src/Link/Link.js @@ -1,9 +1,9 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; +import { elementTypeAcceptingRef } from '@material-ui/utils'; import capitalize from '../utils/capitalize'; import withStyles from '../styles/withStyles'; -import { elementTypeAcceptingRef } from '@material-ui/utils'; import useIsFocusVisible from '../utils/useIsFocusVisible'; import useForkRef from '../utils/useForkRef'; import Typography from '../Typography'; diff --git a/packages/material-ui/src/ListItem/ListItem.js b/packages/material-ui/src/ListItem/ListItem.js index 39d1e2c72aae1e..1f319c543c77b3 100644 --- a/packages/material-ui/src/ListItem/ListItem.js +++ b/packages/material-ui/src/ListItem/ListItem.js @@ -1,4 +1,5 @@ import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { chainPropTypes } from '@material-ui/utils'; @@ -7,7 +8,6 @@ import ButtonBase from '../ButtonBase'; import isMuiElement from '../utils/isMuiElement'; import useForkRef from '../utils/useForkRef'; import ListContext from '../List/ListContext'; -import * as ReactDOM from 'react-dom'; export const styles = (theme) => ({ /* Styles applied to the (normally root) `component` element. May be wrapped by a `container`. */ diff --git a/packages/material-ui/src/ListItem/ListItem.test.js b/packages/material-ui/src/ListItem/ListItem.test.js index 25de891e7ddcfb..f3be77faf3c064 100644 --- a/packages/material-ui/src/ListItem/ListItem.test.js +++ b/packages/material-ui/src/ListItem/ListItem.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import PropTypes from 'prop-types'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent, queries, screen } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import ListItemText from '../ListItemText'; import ListItemSecondaryAction from '../ListItemSecondaryAction'; import ListItem from './ListItem'; diff --git a/packages/material-ui/src/ListSubheader/ListSubheader.d.ts b/packages/material-ui/src/ListSubheader/ListSubheader.d.ts index a896fbcdfc11fb..126855bd0653bf 100644 --- a/packages/material-ui/src/ListSubheader/ListSubheader.d.ts +++ b/packages/material-ui/src/ListSubheader/ListSubheader.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { StandardProps } from '..'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; export interface ListSubheaderTypeMap
{ diff --git a/packages/material-ui/src/Menu/Menu.d.ts b/packages/material-ui/src/Menu/Menu.d.ts index e84e379ee45130..df62c39be1c159 100644 --- a/packages/material-ui/src/Menu/Menu.d.ts +++ b/packages/material-ui/src/Menu/Menu.d.ts @@ -1,7 +1,6 @@ import * as React from 'react'; import { PopoverProps } from '../Popover'; import { MenuListProps } from '../MenuList'; -import { PaperProps } from '../Paper'; import { StandardProps } from '..'; import { TransitionHandlerProps, TransitionProps } from '../transitions/transition'; diff --git a/packages/material-ui/src/Menu/Menu.js b/packages/material-ui/src/Menu/Menu.js index deae57fb09f20d..08abb78b8db7a1 100644 --- a/packages/material-ui/src/Menu/Menu.js +++ b/packages/material-ui/src/Menu/Menu.js @@ -1,4 +1,5 @@ import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import { isFragment } from 'react-is'; import PropTypes from 'prop-types'; import clsx from 'clsx'; @@ -6,7 +7,6 @@ import { HTMLElementType } from '@material-ui/utils'; import withStyles from '../styles/withStyles'; import Popover from '../Popover'; import MenuList from '../MenuList'; -import * as ReactDOM from 'react-dom'; import setRef from '../utils/setRef'; import useTheme from '../styles/useTheme'; diff --git a/packages/material-ui/src/MenuItem/MenuItem.d.ts b/packages/material-ui/src/MenuItem/MenuItem.d.ts index ab44e0f48d820b..750d2f3263c725 100644 --- a/packages/material-ui/src/MenuItem/MenuItem.d.ts +++ b/packages/material-ui/src/MenuItem/MenuItem.d.ts @@ -1,7 +1,7 @@ +import { Omit } from '@material-ui/types'; import { ListItemTypeMap, ListItemProps } from '../ListItem'; import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { ExtendButtonBase } from '../ButtonBase'; -import { Omit } from '@material-ui/types'; export type MenuItemClassKey = 'root' | 'gutters' | 'selected' | 'dense'; diff --git a/packages/material-ui/src/Modal/Modal.d.ts b/packages/material-ui/src/Modal/Modal.d.ts index 00fb27885619fa..7ee24693098d76 100644 --- a/packages/material-ui/src/Modal/Modal.d.ts +++ b/packages/material-ui/src/Modal/Modal.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StandardProps, ModalManager } from '..'; +import { StandardProps } from '..'; import { BackdropProps } from '../Backdrop'; import { PortalProps } from '../Portal'; diff --git a/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js b/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js index dae353bff0cdc8..f85fb34d38916f 100644 --- a/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js +++ b/packages/material-ui/src/OutlinedInput/OutlinedInput.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import OutlinedInput from './OutlinedInput'; import InputBase from '../InputBase'; diff --git a/packages/material-ui/src/Popover/Popover.js b/packages/material-ui/src/Popover/Popover.js index d123bd4f501506..115e67444d27f2 100644 --- a/packages/material-ui/src/Popover/Popover.js +++ b/packages/material-ui/src/Popover/Popover.js @@ -7,8 +7,8 @@ import { refType, HTMLElementType, } from '@material-ui/utils'; -import debounce from '../utils/debounce'; import clsx from 'clsx'; +import debounce from '../utils/debounce'; import ownerDocument from '../utils/ownerDocument'; import ownerWindow from '../utils/ownerWindow'; import createChainedFunction from '../utils/createChainedFunction'; diff --git a/packages/material-ui/src/RadioGroup/RadioGroup.test.js b/packages/material-ui/src/RadioGroup/RadioGroup.test.js index 28f34d56fc2db2..6d2785aa0c0e22 100644 --- a/packages/material-ui/src/RadioGroup/RadioGroup.test.js +++ b/packages/material-ui/src/RadioGroup/RadioGroup.test.js @@ -4,8 +4,8 @@ import { spy } from 'sinon'; import * as PropTypes from 'prop-types'; import { findOutermostIntrinsic } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormGroup from '../FormGroup'; import Radio from '../Radio'; import RadioGroup from './RadioGroup'; diff --git a/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts b/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts index ae3fa093db4b42..f4eb93c9c18113 100644 --- a/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts +++ b/packages/material-ui/src/RadioGroup/useRadioGroup.d.ts @@ -1,4 +1,3 @@ -import { Context } from 'react'; import { RadioGroupProps } from './RadioGroup'; export interface RadioGroupState extends Pick {} diff --git a/packages/material-ui/src/Select/Select.test.js b/packages/material-ui/src/Select/Select.test.js index 669dd7da941b7b..12b558c4352cb8 100644 --- a/packages/material-ui/src/Select/Select.test.js +++ b/packages/material-ui/src/Select/Select.test.js @@ -1,5 +1,6 @@ import * as React from 'react'; import { expect } from 'chai'; +import { spy, stub, useFakeTimers } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; @@ -9,7 +10,6 @@ import MenuItem from '../MenuItem'; import Input from '../Input'; import InputLabel from '../InputLabel'; import Select from './Select'; -import { spy, stub, useFakeTimers } from 'sinon'; describe('', () => { let classes; diff --git a/packages/material-ui/src/Select/SelectInput.js b/packages/material-ui/src/Select/SelectInput.js index 27446e29a57061..bb4b0f97de6790 100644 --- a/packages/material-ui/src/Select/SelectInput.js +++ b/packages/material-ui/src/Select/SelectInput.js @@ -3,9 +3,9 @@ import { isFragment } from 'react-is'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import MuiError from '@material-ui/utils/macros/MuiError.macro'; +import { refType } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import capitalize from '../utils/capitalize'; -import { refType } from '@material-ui/utils'; import Menu from '../Menu/Menu'; import { isFilled } from '../InputBase/utils'; import useForkRef from '../utils/useForkRef'; diff --git a/packages/material-ui/src/Slide/Slide.d.ts b/packages/material-ui/src/Slide/Slide.d.ts index 1f25d0931037b8..fddc05aa073417 100644 --- a/packages/material-ui/src/Slide/Slide.d.ts +++ b/packages/material-ui/src/Slide/Slide.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface SlideProps extends TransitionProps { diff --git a/packages/material-ui/src/Slide/Slide.js b/packages/material-ui/src/Slide/Slide.js index 05bf9eb0ec5a83..02d1186c017c54 100644 --- a/packages/material-ui/src/Slide/Slide.js +++ b/packages/material-ui/src/Slide/Slide.js @@ -1,9 +1,9 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import * as ReactDOM from 'react-dom'; -import debounce from '../utils/debounce'; import { Transition } from 'react-transition-group'; import { elementAcceptingRef } from '@material-ui/utils'; +import debounce from '../utils/debounce'; import useForkRef from '../utils/useForkRef'; import useTheme from '../styles/useTheme'; import { duration } from '../styles/transitions'; diff --git a/packages/material-ui/src/Slide/Slide.test.js b/packages/material-ui/src/Slide/Slide.test.js index 15b18a2fc3d342..364889730fdc75 100644 --- a/packages/material-ui/src/Slide/Slide.test.js +++ b/packages/material-ui/src/Slide/Slide.test.js @@ -3,13 +3,13 @@ import { expect } from 'chai'; import { spy, stub, useFakeTimers } from 'sinon'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; -import Slide, { setTranslateValue } from './Slide'; import { createMuiTheme, ThemeProvider, unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, } from '@material-ui/core/styles'; import { Transition } from 'react-transition-group'; +import Slide, { setTranslateValue } from './Slide'; import { useForkRef } from '../utils'; describe('', () => { diff --git a/packages/material-ui/src/Step/Step.d.ts b/packages/material-ui/src/Step/Step.d.ts index 40e75292b1e5bf..e89f479a78de77 100644 --- a/packages/material-ui/src/Step/Step.d.ts +++ b/packages/material-ui/src/Step/Step.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { StandardProps } from '..'; -import { Orientation } from '../Stepper'; export interface StepProps extends StandardProps, StepClasskey> { diff --git a/packages/material-ui/src/Step/Step.test.js b/packages/material-ui/src/Step/Step.test.js index 23d05ef7fd8d90..143927893efe15 100644 --- a/packages/material-ui/src/Step/Step.test.js +++ b/packages/material-ui/src/Step/Step.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Step from './Step'; import Stepper from '../Stepper'; import StepLabel from '../StepLabel'; diff --git a/packages/material-ui/src/StepButton/StepButton.d.ts b/packages/material-ui/src/StepButton/StepButton.d.ts index 266f0834d01b3c..54f4673dd925ea 100644 --- a/packages/material-ui/src/StepButton/StepButton.d.ts +++ b/packages/material-ui/src/StepButton/StepButton.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Orientation } from '../Stepper'; import { ButtonBaseTypeMap, ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; import { OverrideProps } from '../OverridableComponent'; diff --git a/packages/material-ui/src/StepButton/StepButton.test.js b/packages/material-ui/src/StepButton/StepButton.test.js index ff9aa661aea8f3..a1f5a5880dfa2f 100644 --- a/packages/material-ui/src/StepButton/StepButton.test.js +++ b/packages/material-ui/src/StepButton/StepButton.test.js @@ -3,13 +3,13 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import { fireEvent } from '@testing-library/dom'; +import describeConformance from '../test-utils/describeConformance'; import StepButton from './StepButton'; import Step from '../Step'; import StepLabel from '../StepLabel'; import ButtonBase from '../ButtonBase'; -import { fireEvent } from '@testing-library/dom'; describe('', () => { let classes; diff --git a/packages/material-ui/src/StepContent/StepContent.d.ts b/packages/material-ui/src/StepContent/StepContent.d.ts index 596eeb5bf262c5..1b956ab7118cd4 100644 --- a/packages/material-ui/src/StepContent/StepContent.d.ts +++ b/packages/material-ui/src/StepContent/StepContent.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { StandardProps } from '..'; -import { Orientation } from '../Stepper'; import { TransitionProps } from '../transitions/transition'; export interface StepContentProps diff --git a/packages/material-ui/src/Stepper/Stepper.test.js b/packages/material-ui/src/Stepper/Stepper.test.js index 229848f518550f..73071719741384 100644 --- a/packages/material-ui/src/Stepper/Stepper.test.js +++ b/packages/material-ui/src/Stepper/Stepper.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Paper from '../Paper'; import Step from '../Step'; import StepLabel from '../StepLabel'; diff --git a/packages/material-ui/src/Switch/Switch.test.js b/packages/material-ui/src/Switch/Switch.test.js index 3e6b57a69006ad..0e663f2d5ad10f 100644 --- a/packages/material-ui/src/Switch/Switch.test.js +++ b/packages/material-ui/src/Switch/Switch.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl from '../FormControl'; import Switch from './Switch'; diff --git a/packages/material-ui/src/Tab/Tab.test.js b/packages/material-ui/src/Tab/Tab.test.js index afb365bc0e0145..f54d96814e5f42 100644 --- a/packages/material-ui/src/Tab/Tab.test.js +++ b/packages/material-ui/src/Tab/Tab.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Tab from './Tab'; import ButtonBase from '../ButtonBase'; diff --git a/packages/material-ui/src/Table/Table.test.js b/packages/material-ui/src/Table/Table.test.js index cc9af272d8cad5..d01cceefed7935 100644 --- a/packages/material-ui/src/Table/Table.test.js +++ b/packages/material-ui/src/Table/Table.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Table from './Table'; import TableContext from './TableContext'; diff --git a/packages/material-ui/src/TableBody/TableBody.test.js b/packages/material-ui/src/TableBody/TableBody.test.js index ef929c17c46452..511a8b84c13e4e 100644 --- a/packages/material-ui/src/TableBody/TableBody.test.js +++ b/packages/material-ui/src/TableBody/TableBody.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableBody from './TableBody'; import Tablelvl2Context from '../Table/Tablelvl2Context'; diff --git a/packages/material-ui/src/TableFooter/TableFooter.test.js b/packages/material-ui/src/TableFooter/TableFooter.test.js index bc3feab52c61e8..03fd191a41e2c9 100644 --- a/packages/material-ui/src/TableFooter/TableFooter.test.js +++ b/packages/material-ui/src/TableFooter/TableFooter.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableFooter from './TableFooter'; import Tablelvl2Context from '../Table/Tablelvl2Context'; diff --git a/packages/material-ui/src/TableHead/TableHead.test.js b/packages/material-ui/src/TableHead/TableHead.test.js index 9c047fcb191a7f..5498999120c7bc 100644 --- a/packages/material-ui/src/TableHead/TableHead.test.js +++ b/packages/material-ui/src/TableHead/TableHead.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableHead from './TableHead'; import Tablelvl2Context from '../Table/Tablelvl2Context'; diff --git a/packages/material-ui/src/TablePagination/TablePagination.d.ts b/packages/material-ui/src/TablePagination/TablePagination.d.ts index 4fbdab95b7dfd6..b192123b31f4b1 100644 --- a/packages/material-ui/src/TablePagination/TablePagination.d.ts +++ b/packages/material-ui/src/TablePagination/TablePagination.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { Omit } from '@material-ui/types'; +import { OverridableComponent, OverrideProps } from '../OverridableComponent'; import { TablePaginationActionsProps } from './TablePaginationActions'; import { TableCellProps } from '../TableCell'; import { IconButtonProps } from '../IconButton'; diff --git a/packages/material-ui/src/TableRow/TableRow.test.js b/packages/material-ui/src/TableRow/TableRow.test.js index 88218e6df43b99..4380f9a98b0af2 100644 --- a/packages/material-ui/src/TableRow/TableRow.test.js +++ b/packages/material-ui/src/TableRow/TableRow.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import TableRow from './TableRow'; describe('', () => { diff --git a/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts b/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts index b61c24e936ad4d..b8680d9fa15ce6 100644 --- a/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts +++ b/packages/material-ui/src/TableSortLabel/TableSortLabel.d.ts @@ -1,6 +1,5 @@ import * as React from 'react'; import { ExtendButtonBase, ExtendButtonBaseTypeMap } from '../ButtonBase'; -import { SvgIconProps } from '../SvgIcon'; import { OverrideProps } from '../OverridableComponent'; export type TableSortLabelTypeMap< diff --git a/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js b/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js index b935958380f94b..b2ea91a66c0b34 100644 --- a/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js +++ b/packages/material-ui/src/TableSortLabel/TableSortLabel.test.js @@ -3,10 +3,10 @@ import { expect } from 'chai'; import { createClientRender } from 'test/utils/createClientRender'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; +import Sort from '@material-ui/icons/Sort'; import describeConformance from '../test-utils/describeConformance'; import TableSortLabel from './TableSortLabel'; import ButtonBase from '../ButtonBase'; -import Sort from '@material-ui/icons/Sort'; describe('', () => { const mount = createMount(); diff --git a/packages/material-ui/src/Tabs/ScrollbarSize.test.js b/packages/material-ui/src/Tabs/ScrollbarSize.test.js index 232b1e4d580b83..7ea3f5deef5960 100644 --- a/packages/material-ui/src/Tabs/ScrollbarSize.test.js +++ b/packages/material-ui/src/Tabs/ScrollbarSize.test.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { spy, useFakeTimers, stub } from 'sinon'; -import ScrollbarSize from './ScrollbarSize'; import { createClientRender } from 'test/utils/createClientRender'; +import ScrollbarSize from './ScrollbarSize'; describe('', () => { let clock; diff --git a/packages/material-ui/src/Tabs/Tabs.js b/packages/material-ui/src/Tabs/Tabs.js index b37ea86c69bd7f..7e75fda39c7718 100644 --- a/packages/material-ui/src/Tabs/Tabs.js +++ b/packages/material-ui/src/Tabs/Tabs.js @@ -197,6 +197,8 @@ const Tabs = React.forwardRef(function Tabs(props, ref) { [size]: tabMeta ? tabMeta[size] : 0, }; + // IE 11 support, replace with Number.isNaN + // eslint-disable-next-line no-restricted-globals if (isNaN(indicatorStyle[start]) || isNaN(indicatorStyle[size])) { setIndicatorStyle(newIndicatorStyle); } else { diff --git a/packages/material-ui/src/TextField/TextField.test.js b/packages/material-ui/src/TextField/TextField.test.js index 2455634be3aef2..d5d239ed94250e 100644 --- a/packages/material-ui/src/TextField/TextField.test.js +++ b/packages/material-ui/src/TextField/TextField.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import FormControl from '../FormControl'; import Input from '../Input'; import OutlinedInput from '../OutlinedInput'; diff --git a/packages/material-ui/src/Toolbar/Toolbar.test.js b/packages/material-ui/src/Toolbar/Toolbar.test.js index 0d00f02fbddcee..72f7b61b88b4e7 100644 --- a/packages/material-ui/src/Toolbar/Toolbar.test.js +++ b/packages/material-ui/src/Toolbar/Toolbar.test.js @@ -2,8 +2,8 @@ import * as React from 'react'; import { expect } from 'chai'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import Toolbar from './Toolbar'; describe('', () => { diff --git a/packages/material-ui/src/Tooltip/Tooltip.test.js b/packages/material-ui/src/Tooltip/Tooltip.test.js index 3787507c56f438..fb7c772e7a2a84 100644 --- a/packages/material-ui/src/Tooltip/Tooltip.test.js +++ b/packages/material-ui/src/Tooltip/Tooltip.test.js @@ -3,11 +3,11 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; +import { camelCase } from 'lodash/string'; import { act, createClientRender, fireEvent } from 'test/utils/createClientRender'; import describeConformance from '../test-utils/describeConformance'; import Tooltip, { testReset } from './Tooltip'; import Input from '../Input'; -import { camelCase } from 'lodash/string'; function focusVisible(element) { act(() => { diff --git a/packages/material-ui/src/Typography/Typography.d.ts b/packages/material-ui/src/Typography/Typography.d.ts index 3d71c929242923..c965102f68324b 100644 --- a/packages/material-ui/src/Typography/Typography.d.ts +++ b/packages/material-ui/src/Typography/Typography.d.ts @@ -1,6 +1,6 @@ import * as React from 'react'; -import { StandardProps, PropTypes } from '..'; -import { OverrideProps, OverridableTypeMap, OverridableComponent } from '../OverridableComponent'; +import { PropTypes } from '..'; +import { OverrideProps, OverridableComponent } from '../OverridableComponent'; import { Variant } from '../styles/createTypography'; export interface TypographyTypeMap { diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts index 6a29f198d9b44f..f2413e553a356d 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import * as React from 'react'; export interface TrapFocusProps { diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js index 97fac726d1169e..6d33026259c8c6 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js @@ -1,10 +1,10 @@ -/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex, camelcase */ +/* eslint-disable @typescript-eslint/naming-convention, consistent-return, jsx-a11y/no-noninteractive-tabindex */ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; +import { exactProp } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import useForkRef from '../utils/useForkRef'; -import { exactProp } from '@material-ui/utils'; /** * Utility component that locks focus inside the component. diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js index 087bb43fbc7fae..5bc05483297738 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { useFakeTimers } from 'sinon'; import { expect } from 'chai'; -import TrapFocus from './Unstable_TrapFocus'; import { createClientRender, fireEvent, screen } from 'test/utils/createClientRender'; +import TrapFocus from './Unstable_TrapFocus'; import Portal from '../Portal'; describe('', () => { diff --git a/packages/material-ui/src/Zoom/Zoom.d.ts b/packages/material-ui/src/Zoom/Zoom.d.ts index ca1a5e1d5ce279..09b89ac4c3032d 100644 --- a/packages/material-ui/src/Zoom/Zoom.d.ts +++ b/packages/material-ui/src/Zoom/Zoom.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface ZoomProps extends TransitionProps { diff --git a/packages/material-ui/src/Zoom/Zoom.test.js b/packages/material-ui/src/Zoom/Zoom.test.js index edb4e95f8ee2b0..f06cb73bd92c8d 100644 --- a/packages/material-ui/src/Zoom/Zoom.test.js +++ b/packages/material-ui/src/Zoom/Zoom.test.js @@ -3,11 +3,11 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; +import { Transition } from 'react-transition-group'; import { unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, ThemeProvider, } from '../styles'; -import { Transition } from 'react-transition-group'; import Zoom from './Zoom'; describe('', () => { diff --git a/packages/material-ui/src/index.d.ts b/packages/material-ui/src/index.d.ts index d43649def02d15..a3a8c91cb8be64 100644 --- a/packages/material-ui/src/index.d.ts +++ b/packages/material-ui/src/index.d.ts @@ -1,6 +1,7 @@ import * as React from 'react'; import { Omit } from '@material-ui/types'; import { StyledComponentProps } from './styles'; + export { StyledComponentProps }; /** @@ -51,6 +52,7 @@ export namespace PropTypes { } // From index.js +// eslint-disable-next-line import/first import * as colors from './colors'; export { colors }; diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js index 55f554af478a7c..f7fb087b59eae6 100644 --- a/packages/material-ui/src/index.js +++ b/packages/material-ui/src/index.js @@ -339,7 +339,6 @@ export * from './Tooltip'; export { default as Typography } from './Typography'; export * from './Typography'; -// eslint-disable-next-line camelcase export { default as Unstable_TrapFocus } from './Unstable_TrapFocus'; export * from './Unstable_TrapFocus'; diff --git a/packages/material-ui/src/internal/SwitchBase.test.js b/packages/material-ui/src/internal/SwitchBase.test.js index b09d42611ebffb..79664390d0fe18 100644 --- a/packages/material-ui/src/internal/SwitchBase.test.js +++ b/packages/material-ui/src/internal/SwitchBase.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import SwitchBase from './SwitchBase'; import FormControl, { useFormControl } from '../FormControl'; import IconButton from '../IconButton'; diff --git a/packages/material-ui/src/styles/colorManipulator.js b/packages/material-ui/src/styles/colorManipulator.js index e228e9ca01be6a..5b9e874efe1858 100644 --- a/packages/material-ui/src/styles/colorManipulator.js +++ b/packages/material-ui/src/styles/colorManipulator.js @@ -1,5 +1,5 @@ import MuiError from '@material-ui/utils/macros/MuiError.macro'; -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ /** * Returns a number whose value is limited to the given range. diff --git a/packages/material-ui/src/styles/createTypography.d.ts b/packages/material-ui/src/styles/createTypography.d.ts index 42243fb6b03155..27edadb55f37b1 100644 --- a/packages/material-ui/src/styles/createTypography.d.ts +++ b/packages/material-ui/src/styles/createTypography.d.ts @@ -1,5 +1,5 @@ -import { Palette } from './createPalette'; import * as React from 'react'; +import { Palette } from './createPalette'; import { CSSProperties } from './withStyles'; export type Variant = diff --git a/packages/material-ui/src/styles/index.js b/packages/material-ui/src/styles/index.js index 4b20b716f13994..53625e9e785c29 100644 --- a/packages/material-ui/src/styles/index.js +++ b/packages/material-ui/src/styles/index.js @@ -1,6 +1,5 @@ export * from './colorManipulator'; export { default as createMuiTheme } from './createMuiTheme'; -// eslint-disable-next-line camelcase export { default as unstable_createMuiStrictModeTheme } from './createMuiStrictModeTheme'; export { default as createStyles } from './createStyles'; export { default as makeStyles } from './makeStyles'; diff --git a/packages/material-ui/src/styles/makeStyles.d.ts b/packages/material-ui/src/styles/makeStyles.d.ts index 0581923403e100..07908af194078f 100644 --- a/packages/material-ui/src/styles/makeStyles.d.ts +++ b/packages/material-ui/src/styles/makeStyles.d.ts @@ -1,7 +1,6 @@ -import { Theme as DefaultTheme } from './createMuiTheme'; import { ClassNameMap, Styles, WithStylesOptions } from '@material-ui/styles/withStyles'; - import { Omit } from '@material-ui/types'; +import { Theme as DefaultTheme } from './createMuiTheme'; /** * `makeStyles` where the passed `styles` do not depend on props diff --git a/packages/material-ui/src/styles/responsiveFontSizes.test.js b/packages/material-ui/src/styles/responsiveFontSizes.test.js index 2221406cb38fb6..bd9d7e4d7cfaeb 100644 --- a/packages/material-ui/src/styles/responsiveFontSizes.test.js +++ b/packages/material-ui/src/styles/responsiveFontSizes.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import responsiveFontSizes from './responsiveFontSizes'; import { createMuiTheme } from '@material-ui/core/styles'; +import responsiveFontSizes from './responsiveFontSizes'; describe('responsiveFontSizes', () => { it('should support unitless line height', () => { diff --git a/packages/material-ui/src/styles/styled.d.ts b/packages/material-ui/src/styles/styled.d.ts index 0414fde1bfd65c..6ed2805893d232 100644 --- a/packages/material-ui/src/styles/styled.d.ts +++ b/packages/material-ui/src/styles/styled.d.ts @@ -1,3 +1,4 @@ +import * as React from 'react'; import { Omit } from '@material-ui/types'; import { CreateCSSProperties, @@ -5,7 +6,6 @@ import { WithStylesOptions, } from '@material-ui/styles/withStyles'; import { Theme as DefaultTheme } from './createMuiTheme'; -import * as React from 'react'; // These definitions are almost identical to the ones in @material-ui/styles/styled // Only difference is that ComponentCreator has a default theme type diff --git a/packages/material-ui/src/styles/transitions.js b/packages/material-ui/src/styles/transitions.js index 6012d67fbd8bd3..a127a1c0c55326 100644 --- a/packages/material-ui/src/styles/transitions.js +++ b/packages/material-ui/src/styles/transitions.js @@ -53,6 +53,8 @@ export default { if (process.env.NODE_ENV !== 'production') { const isString = (value) => typeof value === 'string'; + // IE 11 support, replace with Number.isNaN + // eslint-disable-next-line no-restricted-globals const isNumber = (value) => !isNaN(parseFloat(value)); if (!isString(props) && !Array.isArray(props)) { console.error('Material-UI: Argument "props" must be a string or Array.'); diff --git a/packages/material-ui/src/styles/transitions.test.js b/packages/material-ui/src/styles/transitions.test.js index 6d537db1bfa80f..665ba3c847b8ce 100644 --- a/packages/material-ui/src/styles/transitions.test.js +++ b/packages/material-ui/src/styles/transitions.test.js @@ -138,10 +138,13 @@ describe('transitions', () => { it('should return NaN when passed a negative number', () => { const zeroHeightDurationNegativeOne = transitions.getAutoHeightDuration(-1); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationNegativeOne)).to.equal(true); const zeroHeightDurationSmallNegative = transitions.getAutoHeightDuration(-0.000001); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationSmallNegative)).to.equal(true); const zeroHeightDurationBigNegative = transitions.getAutoHeightDuration(-100000); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationBigNegative)).to.equal(true); }); diff --git a/packages/material-ui/src/styles/withStyles.d.ts b/packages/material-ui/src/styles/withStyles.d.ts index 6b0b2ed5879eae..6b68913f544c09 100644 --- a/packages/material-ui/src/styles/withStyles.d.ts +++ b/packages/material-ui/src/styles/withStyles.d.ts @@ -1,5 +1,4 @@ import { PropInjector } from '@material-ui/types'; -import { Theme } from './createMuiTheme'; import { CreateCSSProperties, CSSProperties, @@ -12,6 +11,7 @@ import { ClassKeyOfStyles, BaseCSSProperties, } from '@material-ui/styles/withStyles'; +import { Theme } from './createMuiTheme'; export { CreateCSSProperties, diff --git a/packages/material-ui/src/styles/withTheme.d.ts b/packages/material-ui/src/styles/withTheme.d.ts index 70025c9a048c54..8d07025e82ca75 100644 --- a/packages/material-ui/src/styles/withTheme.d.ts +++ b/packages/material-ui/src/styles/withTheme.d.ts @@ -1,5 +1,5 @@ -import { Theme } from './createMuiTheme'; import { PropInjector } from '@material-ui/types'; +import { Theme } from './createMuiTheme'; export interface WithTheme { theme: Theme; diff --git a/packages/material-ui/src/test-utils/createMount.js b/packages/material-ui/src/test-utils/createMount.js index ca52bd6bec0cdf..6fe43e024cfaf0 100644 --- a/packages/material-ui/src/test-utils/createMount.js +++ b/packages/material-ui/src/test-utils/createMount.js @@ -24,6 +24,7 @@ class Mode extends React.Component { render() { // Excess props will come from e.g. enzyme setProps + // eslint-disable-next-line @typescript-eslint/naming-convention const { __element, __strict, ...other } = this.props; const Component = __strict ? React.StrictMode : React.Fragment; diff --git a/packages/material-ui/src/test-utils/describeConformance.js b/packages/material-ui/src/test-utils/describeConformance.js index e60a1cca092b7b..1b88b58a8bf36e 100644 --- a/packages/material-ui/src/test-utils/describeConformance.js +++ b/packages/material-ui/src/test-utils/describeConformance.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as React from 'react'; -import findOutermostIntrinsic from './findOutermostIntrinsic'; import ReactTestRenderer from 'react-test-renderer'; +import findOutermostIntrinsic from './findOutermostIntrinsic'; import testRef from './testRef'; /** diff --git a/packages/material-ui/src/utils/index.js b/packages/material-ui/src/utils/index.js index a79c386cfc4104..0c5cddfc7f77ed 100644 --- a/packages/material-ui/src/utils/index.js +++ b/packages/material-ui/src/utils/index.js @@ -12,6 +12,5 @@ export { default as unsupportedProp } from './unsupportedProp'; export { default as useControlled } from './useControlled'; export { default as useEventCallback } from './useEventCallback'; export { default as useForkRef } from './useForkRef'; -// eslint-disable-next-line camelcase export { default as unstable_useId } from './unstable_useId'; export { default as useIsFocusVisible } from './useIsFocusVisible'; diff --git a/packages/material-ui/src/utils/isMuiElement.d.ts b/packages/material-ui/src/utils/isMuiElement.d.ts index bfb5df3b456eef..ffca03d9a690c2 100644 --- a/packages/material-ui/src/utils/isMuiElement.d.ts +++ b/packages/material-ui/src/utils/isMuiElement.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StandardProps } from '../'; +import { StandardProps } from '..'; export type NamedMuiComponent = React.ComponentType & { muiName: string }; diff --git a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts b/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts index fed68f6668aa72..2bbe60bcff0f62 100644 --- a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts +++ b/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts @@ -1,6 +1,6 @@ +import { PropInjector } from '@material-ui/types'; import { Breakpoint } from '../styles/createBreakpoints'; import { WithWidth } from '../withWidth'; -import { PropInjector } from '@material-ui/types'; export interface WithMobileDialogOptions { breakpoint: Breakpoint; diff --git a/packages/material-ui/src/withWidth/withWidth.d.ts b/packages/material-ui/src/withWidth/withWidth.d.ts index 64669acfd1abc0..7d76ce474a7509 100644 --- a/packages/material-ui/src/withWidth/withWidth.d.ts +++ b/packages/material-ui/src/withWidth/withWidth.d.ts @@ -1,5 +1,5 @@ -import { Breakpoint } from '../styles/createBreakpoints'; import { PropInjector } from '@material-ui/types'; +import { Breakpoint } from '../styles/createBreakpoints'; export interface WithWidthOptions { withTheme?: boolean; diff --git a/packages/material-ui/test/typescript/components.spec.tsx b/packages/material-ui/test/typescript/components.spec.tsx index e41a804807a67b..636b042a9df8cb 100644 --- a/packages/material-ui/test/typescript/components.spec.tsx +++ b/packages/material-ui/test/typescript/components.spec.tsx @@ -215,8 +215,7 @@ const CardTest = () => ( adjective well meaning and kindly. - - {'"a benevolent smile"'} + a benevolent smile @@ -233,7 +232,7 @@ const CardMediaTest = () => ( subheader="September 14, 2016" /> - + @@ -252,7 +251,7 @@ const CardMediaTest = () => ( - + Method: @@ -288,7 +287,7 @@ const ChipsTest = () => ( M} label="Clickable Chip" onClick={(e) => log(e)} /> - } label="Deletable Chip" onDelete={(e) => log(e)} /> + } label="Deletable Chip" onDelete={(e) => log(e)} /> @@ -305,7 +304,7 @@ const ChipsTest = () => ( const DialogTest = () => { const emails = ['username@gmail.com', 'user02@gmail.com']; return ( - log(e)} open> + log(event)} open> Set backup account @@ -399,14 +398,19 @@ const DrawerTest = () => { }; return ( - log(e)} onClick={(e) => log(e)}> + log(event)} + onClick={(e) => log(e)} + > List log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} ModalProps={{ hideBackdrop: true, @@ -418,7 +422,7 @@ const DrawerTest = () => { anchor="bottom" variant="temporary" open={open.bottom} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} > List @@ -427,7 +431,7 @@ const DrawerTest = () => { variant="persistent" anchor="right" open={open.right} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} > List @@ -447,7 +451,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -456,7 +460,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} ModalProps={{ @@ -468,7 +472,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -478,7 +482,7 @@ const SwipeableDrawerTest = () => { variant="temporary" anchor="right" open={open.right} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -516,7 +520,7 @@ const GridTest = () => ( ... - + ... @@ -538,7 +542,7 @@ const ListTest = () => ( {[0, 1, 2, 3].map((value) => ( log(e)}> - + @@ -566,8 +570,8 @@ const MenuTest = () => { log(e)} + open + onClose={(event) => log(event)} PopoverClasses={{ paper: 'foo' }} > {options.map((option, index) => ( @@ -691,9 +695,7 @@ const SelectionControlTest = () => { label="Indeterminate" /> - } + control={} label="Custom color" /> @@ -744,9 +746,9 @@ const SnackbarTest = () => ( vertical: 'bottom', horizontal: 'left', }} - open={true} + open autoHideDuration={6000} - onClose={(e) => log(e)} + onClose={(event) => log(event)} ContentProps={ { // 'aria-describedby': 'message-id', @@ -942,9 +944,9 @@ const TabsTest = () => { - {this.state.value === 0 && {'Item One'}} - {this.state.value === 1 && {'Item Two'}} - {this.state.value === 2 && {'Item Three'}} + {this.state.value === 0 && Item One} + {this.state.value === 1 && Item Two} + {this.state.value === 2 && Item Three} ); } @@ -955,15 +957,15 @@ const TabsTest = () => { const TextFieldTest = () => ( - - Name} value={'Alice'} /> + + Name} value="Alice" /> log({ name: event.currentTarget.value })} /> - + ( ); const LinkTest = () => { - const dudUrl = 'javascript:;'; + const dudUrl = 'javascript'; return ( Link - {'color="inherit"'} + inherit - {'variant="body1"'} + body1 ); diff --git a/packages/material-ui/test/typescript/styles.spec.tsx b/packages/material-ui/test/typescript/styles.spec.tsx index 6be0f6dd690aa1..fdc313eaeb1e5b 100644 --- a/packages/material-ui/test/typescript/styles.spec.tsx +++ b/packages/material-ui/test/typescript/styles.spec.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/rules-of-hooks */ import * as React from 'react'; import { createStyles, @@ -164,7 +165,7 @@ const t5 = createMuiTheme().spacing(1, 2, 3, 4, 5); function OverridesTheme() { return ( - {'Overrides'} + Overrides ); } @@ -488,7 +489,7 @@ withStyles((theme) => { // https://github.com/mui-org/material-ui/pull/15546 // Update type definition to let CSS properties be functions - interface testProps { + interface TestProps { foo: boolean; } @@ -496,10 +497,10 @@ withStyles((theme) => { const useStyles = makeStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), }), }); @@ -511,10 +512,10 @@ withStyles((theme) => { const useStyles = makeStyles((theme) => ({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), margin: theme.spacing(1), }), })); @@ -527,10 +528,10 @@ withStyles((theme) => { const styles = createStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), }), }); @@ -542,10 +543,10 @@ withStyles((theme) => { withStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), margin: 8, }), }); @@ -555,10 +556,10 @@ withStyles((theme) => { withStyles((theme) => ({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), height: theme.spacing(1), }), })); @@ -618,18 +619,18 @@ withStyles((theme) => return { padding: theme.spacing(1) }; }); - interface myProps { + interface MyProps { testValue: boolean; } // Type of props follow all the way to css properties - styled(Button)(({ theme, testValue }) => { + styled(Button)(({ theme, testValue }) => { expectType(theme); expectType(testValue); return { padding: (props) => { - expectType(props); + expectType(props); expectType(props.testValue); return theme.spacing(1); diff --git a/packages/typescript-to-proptypes/test/options-test/options.ts b/packages/typescript-to-proptypes/test/options-test/options.ts index 85f340a76c7db1..0d76f3064bb9b8 100644 --- a/packages/typescript-to-proptypes/test/options-test/options.ts +++ b/packages/typescript-to-proptypes/test/options-test/options.ts @@ -6,6 +6,7 @@ const options: TestOptions = { if (name.endsWith('Props')) { return false; } + return true; }, }, injector: { diff --git a/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts b/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts index 5e9d3028d4404d..d9fddc0e5f9303 100644 --- a/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts +++ b/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + interface ButtonProps { variant?: string; } diff --git a/packages/typescript-to-proptypes/test/sort-unions/input.d.ts b/packages/typescript-to-proptypes/test/sort-unions/input.d.ts index 08d90791df5a95..5379600ee91549 100644 --- a/packages/typescript-to-proptypes/test/sort-unions/input.d.ts +++ b/packages/typescript-to-proptypes/test/sort-unions/input.d.ts @@ -1,5 +1,3 @@ -import * as React from 'react'; - type Breakpoint = 'xs' | 'md' | 'xl'; export interface Props { diff --git a/packages/typescript-to-proptypes/test/union-props/input.d.ts b/packages/typescript-to-proptypes/test/union-props/input.d.ts index a4b6a03347078d..551c9bcf1002ff 100644 --- a/packages/typescript-to-proptypes/test/union-props/input.d.ts +++ b/packages/typescript-to-proptypes/test/union-props/input.d.ts @@ -1,5 +1,3 @@ -import * as React from 'react'; - export interface BaseProps { value?: unknown; } diff --git a/scripts/generateProptypes.ts b/scripts/generateProptypes.ts index 37a4728700deae..e4033148770ada 100644 --- a/scripts/generateProptypes.ts +++ b/scripts/generateProptypes.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import * as path from 'path'; import * as fse from 'fs-extra'; import * as ttp from 'typescript-to-proptypes'; @@ -139,6 +140,8 @@ const getSortLiteralUnions: ttp.InjectOptions['getSortLiteralUnions'] = (compone ) { return sortBreakpointsLiteralByViewportAscending; } + + return undefined; }; const tsconfig = ttp.loadConfig(path.resolve(__dirname, '../tsconfig.json')); diff --git a/scripts/listChangedFiles.test.js b/scripts/listChangedFiles.test.js index 24a18d0240856e..5c1360a6e61fdb 100644 --- a/scripts/listChangedFiles.test.js +++ b/scripts/listChangedFiles.test.js @@ -1,8 +1,8 @@ -const listChangedFiles = require('./listChangedFiles'); const fs = require('fs'); const rimraf = require('rimraf'); const { promisify } = require('util'); const { expect } = require('chai'); +const listChangedFiles = require('./listChangedFiles'); const writeFileAsync = promisify(fs.writeFile); const rimrafAsync = promisify(rimraf); diff --git a/test/utils/components.js b/test/utils/components.js index c4ac86bb5590cb..76c47c494ed24a 100644 --- a/test/utils/components.js +++ b/test/utils/components.js @@ -13,7 +13,9 @@ export class ErrorBoundary extends React.Component { children: PropTypes.node.isRequired, }; - state = { error: null }; + state = { + error: null, + }; /** * @public diff --git a/test/utils/createMount.js b/test/utils/createMount.js index 1f9b00453a0f08..fcde56928f558f 100644 --- a/test/utils/createMount.js +++ b/test/utils/createMount.js @@ -28,6 +28,7 @@ class Mode extends React.Component { render() { // Excess props will come from e.g. enzyme setProps + // eslint-disable-next-line @typescript-eslint/naming-convention const { __element, __strict, ...other } = this.props; const Component = __strict ? React.StrictMode : React.Fragment; diff --git a/test/utils/initMatchers.js b/test/utils/initMatchers.js index f7e1e848ab9115..a80d7f19895272 100644 --- a/test/utils/initMatchers.js +++ b/test/utils/initMatchers.js @@ -148,7 +148,7 @@ chai.use((chaiAPI, utils) => { * Correct name for `to.be.visible` */ chai.Assertion.addMethod('toBeVisible', function toBeVisible() { - // eslint-disable-next-line no-underscore-dangle, no-unused-expressions + // eslint-disable-next-line no-underscore-dangle, @typescript-eslint/no-unused-expressions new chai.Assertion(this._obj).to.be.visible; }); }); diff --git a/yarn.lock b/yarn.lock index d84660f8a7fb30..cf256dd121a8b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -344,7 +344,7 @@ resolve "^1.13.1" v8flags "^3.1.1" -"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.10.4", "@babel/parser@^7.7.0", "@babel/parser@^7.7.5": +"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.10.4", "@babel/parser@^7.7.5": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.10.4.tgz#9eedf27e1998d87739fb5028a5120557c06a1a64" integrity sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA== @@ -1050,7 +1050,7 @@ "@babel/parser" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/traverse@^7.10.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.4": +"@babel/traverse@^7.10.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.10.4.tgz#e642e5395a3b09cc95c8e74a27432b484b697818" integrity sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q== @@ -1065,7 +1065,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@7.8.3", "@babel/types@7.9.6", "@babel/types@^7.0.0", "@babel/types@^7.10.2", "@babel/types@^7.10.4", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.6.1", "@babel/types@^7.7.0": +"@babel/types@7.8.3", "@babel/types@7.9.6", "@babel/types@^7.0.0", "@babel/types@^7.10.2", "@babel/types@^7.10.4", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.6.1": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.10.4.tgz#369517188352e18219981efd156bfdb199fff1ee" integrity sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg== @@ -2495,6 +2495,11 @@ "@types/cheerio" "*" "@types/react" "*" +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/eslint@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.0.tgz#eb5c5b575237334df24c53195e37b53d66478d7b" @@ -2565,7 +2570,7 @@ "@types/parse5" "*" "@types/tough-cookie" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.4": +"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.4": version "7.0.5" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ== @@ -2822,6 +2827,66 @@ dependencies: "@types/node" "*" +"@typescript-eslint/eslint-plugin@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.0.tgz#ba2b6cae478b8fca3f2e58ff1313e4198eea2d8a" + integrity sha512-ubHlHVt1lsPQB/CZdEov9XuOFhNG9YRC//kuiS1cMQI6Bs1SsqKrEmZnpgRwthGR09/kEDtr9MywlqXyyYd8GA== + dependencies: + "@typescript-eslint/experimental-utils" "3.6.0" + debug "^4.1.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.0.tgz#0138152d66e3e53a6340f606793fb257bf2d76a1" + integrity sha512-4Vdf2hvYMUnTdkCNZu+yYlFtL2v+N2R7JOynIOkFbPjf9o9wQvRwRkzUdWlFd2YiiUwJLbuuLnl5civNg5ykOQ== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/typescript-estree" "3.6.0" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + +"@typescript-eslint/parser@^3.1.0", "@typescript-eslint/parser@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.6.0.tgz#79b5232e1a2d06f1fc745942b690cd87aca7b60e" + integrity sha512-taghDxuLhbDAD1U5Fk8vF+MnR0yiFE9Z3v2/bYScFb0N1I9SK8eKHkdJl1DAD48OGFDMFTeOTX0z7g0W6SYUXw== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "3.6.0" + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/typescript-estree" "3.6.0" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/types@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.6.0.tgz#4bd6eee55d2f9d35a4b36c4804be1880bf68f7bc" + integrity sha512-JwVj74ohUSt0ZPG+LZ7hb95fW8DFOqBuR6gE7qzq55KDI3BepqsCtHfBIoa0+Xi1AI7fq5nCu2VQL8z4eYftqg== + +"@typescript-eslint/typescript-estree@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.0.tgz#9b4cab43f1192b64ff51530815b8919f166ce177" + integrity sha512-G57NDSABHjvob7zVV09ehWyD1K6/YUKjz5+AufObFyjNO4DVmKejj47MHjVHHlZZKgmpJD2yyH9lfCXHrPITFg== + dependencies: + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/visitor-keys" "3.6.0" + debug "^4.1.1" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/visitor-keys@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.0.tgz#44185eb0cc47651034faa95c5e2e8b314ecebb26" + integrity sha512-p1izllL2Ubwunite0ITjubuMQRBGgjdVYwyG7lXPX8GbrA6qF0uwSRz9MnXZaHMxID4948gX0Ez8v9tUDi/KfQ== + dependencies: + eslint-visitor-keys "^1.1.0" + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -3659,18 +3724,6 @@ babel-core@^7.0.0-bridge.0: resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== -babel-eslint@^10.0.3, babel-eslint@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - babel-loader@^8.0.0: version "8.1.0" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.1.0.tgz#c611d5112bd5209abe8b9fa84c3e4da25275f1c3" @@ -6787,7 +6840,7 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" -eslint-config-airbnb-base@^14.2.0: +eslint-config-airbnb-base@^14.1.0, eslint-config-airbnb-base@^14.2.0: version "14.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz#fe89c24b3f9dc8008c9c0d0d88c28f95ed65e9c4" integrity sha512-Snswd5oC6nJaevs3nZoLSTvGJBvzTfnBqOIArkf3cbyTyq9UD79wOk8s+RiL6bhca0p/eRO6veczhf6A/7Jy8Q== @@ -6796,7 +6849,16 @@ eslint-config-airbnb-base@^14.2.0: object.assign "^4.1.0" object.entries "^1.1.2" -eslint-config-airbnb@^18.2.0: +eslint-config-airbnb-typescript@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-8.0.2.tgz#465b17b0b1facdcca4fe23a5426bc27ab7b2b2f2" + integrity sha512-TCOftyCoIogJzzLGSg0Qlxd27qvf+1a3MHyN/PqynTqINS4iFy+SlXy/CrAN+6xkleGMSrvmPbm3pyFEku2+IQ== + dependencies: + "@typescript-eslint/parser" "^3.1.0" + eslint-config-airbnb "^18.1.0" + eslint-config-airbnb-base "^14.1.0" + +eslint-config-airbnb@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.0.tgz#8a82168713effce8fc08e10896a63f1235499dcd" integrity sha512-Fz4JIUKkrhO0du2cg5opdyPKQXOI2MvF8KUvN2710nJMT6jaRUpRE2swrJftAjVGL7T1otLM5ieo5RqS1v9Udg== @@ -6930,7 +6992,7 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^5.1.0: +eslint-scope@^5.0.0, eslint-scope@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w== @@ -6945,7 +7007,7 @@ eslint-utils@^2.0.0: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.2.0: +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -13653,7 +13715,7 @@ regexp.prototype.flags@^1.3.0: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" -regexpp@^3.1.0: +regexpp@^3.0.0, regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== @@ -15716,6 +15778,13 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" +tsutils@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
{ diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts index 6a29f198d9b44f..f2413e553a356d 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ import * as React from 'react'; export interface TrapFocusProps { diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js index 97fac726d1169e..6d33026259c8c6 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.js @@ -1,10 +1,10 @@ -/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex, camelcase */ +/* eslint-disable @typescript-eslint/naming-convention, consistent-return, jsx-a11y/no-noninteractive-tabindex */ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import PropTypes from 'prop-types'; +import { exactProp } from '@material-ui/utils'; import ownerDocument from '../utils/ownerDocument'; import useForkRef from '../utils/useForkRef'; -import { exactProp } from '@material-ui/utils'; /** * Utility component that locks focus inside the component. diff --git a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js index 087bb43fbc7fae..5bc05483297738 100644 --- a/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js +++ b/packages/material-ui/src/Unstable_TrapFocus/Unstable_TrapFocus.test.js @@ -1,8 +1,8 @@ import * as React from 'react'; import { useFakeTimers } from 'sinon'; import { expect } from 'chai'; -import TrapFocus from './Unstable_TrapFocus'; import { createClientRender, fireEvent, screen } from 'test/utils/createClientRender'; +import TrapFocus from './Unstable_TrapFocus'; import Portal from '../Portal'; describe('', () => { diff --git a/packages/material-ui/src/Zoom/Zoom.d.ts b/packages/material-ui/src/Zoom/Zoom.d.ts index ca1a5e1d5ce279..09b89ac4c3032d 100644 --- a/packages/material-ui/src/Zoom/Zoom.d.ts +++ b/packages/material-ui/src/Zoom/Zoom.d.ts @@ -1,5 +1,4 @@ import * as React from 'react'; -import { Theme } from '../styles/createMuiTheme'; import { TransitionProps } from '../transitions/transition'; export interface ZoomProps extends TransitionProps { diff --git a/packages/material-ui/src/Zoom/Zoom.test.js b/packages/material-ui/src/Zoom/Zoom.test.js index edb4e95f8ee2b0..f06cb73bd92c8d 100644 --- a/packages/material-ui/src/Zoom/Zoom.test.js +++ b/packages/material-ui/src/Zoom/Zoom.test.js @@ -3,11 +3,11 @@ import { expect } from 'chai'; import { spy, useFakeTimers } from 'sinon'; import createMount from 'test/utils/createMount'; import describeConformance from '@material-ui/core/test-utils/describeConformance'; +import { Transition } from 'react-transition-group'; import { unstable_createMuiStrictModeTheme as createMuiStrictModeTheme, ThemeProvider, } from '../styles'; -import { Transition } from 'react-transition-group'; import Zoom from './Zoom'; describe('', () => { diff --git a/packages/material-ui/src/index.d.ts b/packages/material-ui/src/index.d.ts index d43649def02d15..a3a8c91cb8be64 100644 --- a/packages/material-ui/src/index.d.ts +++ b/packages/material-ui/src/index.d.ts @@ -1,6 +1,7 @@ import * as React from 'react'; import { Omit } from '@material-ui/types'; import { StyledComponentProps } from './styles'; + export { StyledComponentProps }; /** @@ -51,6 +52,7 @@ export namespace PropTypes { } // From index.js +// eslint-disable-next-line import/first import * as colors from './colors'; export { colors }; diff --git a/packages/material-ui/src/index.js b/packages/material-ui/src/index.js index 55f554af478a7c..f7fb087b59eae6 100644 --- a/packages/material-ui/src/index.js +++ b/packages/material-ui/src/index.js @@ -339,7 +339,6 @@ export * from './Tooltip'; export { default as Typography } from './Typography'; export * from './Typography'; -// eslint-disable-next-line camelcase export { default as Unstable_TrapFocus } from './Unstable_TrapFocus'; export * from './Unstable_TrapFocus'; diff --git a/packages/material-ui/src/internal/SwitchBase.test.js b/packages/material-ui/src/internal/SwitchBase.test.js index b09d42611ebffb..79664390d0fe18 100644 --- a/packages/material-ui/src/internal/SwitchBase.test.js +++ b/packages/material-ui/src/internal/SwitchBase.test.js @@ -3,8 +3,8 @@ import { expect } from 'chai'; import { spy } from 'sinon'; import { getClasses } from '@material-ui/core/test-utils'; import createMount from 'test/utils/createMount'; -import describeConformance from '../test-utils/describeConformance'; import { act, createClientRender } from 'test/utils/createClientRender'; +import describeConformance from '../test-utils/describeConformance'; import SwitchBase from './SwitchBase'; import FormControl, { useFormControl } from '../FormControl'; import IconButton from '../IconButton'; diff --git a/packages/material-ui/src/styles/colorManipulator.js b/packages/material-ui/src/styles/colorManipulator.js index e228e9ca01be6a..5b9e874efe1858 100644 --- a/packages/material-ui/src/styles/colorManipulator.js +++ b/packages/material-ui/src/styles/colorManipulator.js @@ -1,5 +1,5 @@ import MuiError from '@material-ui/utils/macros/MuiError.macro'; -/* eslint-disable no-use-before-define */ +/* eslint-disable @typescript-eslint/no-use-before-define */ /** * Returns a number whose value is limited to the given range. diff --git a/packages/material-ui/src/styles/createTypography.d.ts b/packages/material-ui/src/styles/createTypography.d.ts index 42243fb6b03155..27edadb55f37b1 100644 --- a/packages/material-ui/src/styles/createTypography.d.ts +++ b/packages/material-ui/src/styles/createTypography.d.ts @@ -1,5 +1,5 @@ -import { Palette } from './createPalette'; import * as React from 'react'; +import { Palette } from './createPalette'; import { CSSProperties } from './withStyles'; export type Variant = diff --git a/packages/material-ui/src/styles/index.js b/packages/material-ui/src/styles/index.js index 4b20b716f13994..53625e9e785c29 100644 --- a/packages/material-ui/src/styles/index.js +++ b/packages/material-ui/src/styles/index.js @@ -1,6 +1,5 @@ export * from './colorManipulator'; export { default as createMuiTheme } from './createMuiTheme'; -// eslint-disable-next-line camelcase export { default as unstable_createMuiStrictModeTheme } from './createMuiStrictModeTheme'; export { default as createStyles } from './createStyles'; export { default as makeStyles } from './makeStyles'; diff --git a/packages/material-ui/src/styles/makeStyles.d.ts b/packages/material-ui/src/styles/makeStyles.d.ts index 0581923403e100..07908af194078f 100644 --- a/packages/material-ui/src/styles/makeStyles.d.ts +++ b/packages/material-ui/src/styles/makeStyles.d.ts @@ -1,7 +1,6 @@ -import { Theme as DefaultTheme } from './createMuiTheme'; import { ClassNameMap, Styles, WithStylesOptions } from '@material-ui/styles/withStyles'; - import { Omit } from '@material-ui/types'; +import { Theme as DefaultTheme } from './createMuiTheme'; /** * `makeStyles` where the passed `styles` do not depend on props diff --git a/packages/material-ui/src/styles/responsiveFontSizes.test.js b/packages/material-ui/src/styles/responsiveFontSizes.test.js index 2221406cb38fb6..bd9d7e4d7cfaeb 100644 --- a/packages/material-ui/src/styles/responsiveFontSizes.test.js +++ b/packages/material-ui/src/styles/responsiveFontSizes.test.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; -import responsiveFontSizes from './responsiveFontSizes'; import { createMuiTheme } from '@material-ui/core/styles'; +import responsiveFontSizes from './responsiveFontSizes'; describe('responsiveFontSizes', () => { it('should support unitless line height', () => { diff --git a/packages/material-ui/src/styles/styled.d.ts b/packages/material-ui/src/styles/styled.d.ts index 0414fde1bfd65c..6ed2805893d232 100644 --- a/packages/material-ui/src/styles/styled.d.ts +++ b/packages/material-ui/src/styles/styled.d.ts @@ -1,3 +1,4 @@ +import * as React from 'react'; import { Omit } from '@material-ui/types'; import { CreateCSSProperties, @@ -5,7 +6,6 @@ import { WithStylesOptions, } from '@material-ui/styles/withStyles'; import { Theme as DefaultTheme } from './createMuiTheme'; -import * as React from 'react'; // These definitions are almost identical to the ones in @material-ui/styles/styled // Only difference is that ComponentCreator has a default theme type diff --git a/packages/material-ui/src/styles/transitions.js b/packages/material-ui/src/styles/transitions.js index 6012d67fbd8bd3..a127a1c0c55326 100644 --- a/packages/material-ui/src/styles/transitions.js +++ b/packages/material-ui/src/styles/transitions.js @@ -53,6 +53,8 @@ export default { if (process.env.NODE_ENV !== 'production') { const isString = (value) => typeof value === 'string'; + // IE 11 support, replace with Number.isNaN + // eslint-disable-next-line no-restricted-globals const isNumber = (value) => !isNaN(parseFloat(value)); if (!isString(props) && !Array.isArray(props)) { console.error('Material-UI: Argument "props" must be a string or Array.'); diff --git a/packages/material-ui/src/styles/transitions.test.js b/packages/material-ui/src/styles/transitions.test.js index 6d537db1bfa80f..665ba3c847b8ce 100644 --- a/packages/material-ui/src/styles/transitions.test.js +++ b/packages/material-ui/src/styles/transitions.test.js @@ -138,10 +138,13 @@ describe('transitions', () => { it('should return NaN when passed a negative number', () => { const zeroHeightDurationNegativeOne = transitions.getAutoHeightDuration(-1); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationNegativeOne)).to.equal(true); const zeroHeightDurationSmallNegative = transitions.getAutoHeightDuration(-0.000001); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationSmallNegative)).to.equal(true); const zeroHeightDurationBigNegative = transitions.getAutoHeightDuration(-100000); + // eslint-disable-next-line no-restricted-globals expect(isNaN(zeroHeightDurationBigNegative)).to.equal(true); }); diff --git a/packages/material-ui/src/styles/withStyles.d.ts b/packages/material-ui/src/styles/withStyles.d.ts index 6b0b2ed5879eae..6b68913f544c09 100644 --- a/packages/material-ui/src/styles/withStyles.d.ts +++ b/packages/material-ui/src/styles/withStyles.d.ts @@ -1,5 +1,4 @@ import { PropInjector } from '@material-ui/types'; -import { Theme } from './createMuiTheme'; import { CreateCSSProperties, CSSProperties, @@ -12,6 +11,7 @@ import { ClassKeyOfStyles, BaseCSSProperties, } from '@material-ui/styles/withStyles'; +import { Theme } from './createMuiTheme'; export { CreateCSSProperties, diff --git a/packages/material-ui/src/styles/withTheme.d.ts b/packages/material-ui/src/styles/withTheme.d.ts index 70025c9a048c54..8d07025e82ca75 100644 --- a/packages/material-ui/src/styles/withTheme.d.ts +++ b/packages/material-ui/src/styles/withTheme.d.ts @@ -1,5 +1,5 @@ -import { Theme } from './createMuiTheme'; import { PropInjector } from '@material-ui/types'; +import { Theme } from './createMuiTheme'; export interface WithTheme { theme: Theme; diff --git a/packages/material-ui/src/test-utils/createMount.js b/packages/material-ui/src/test-utils/createMount.js index ca52bd6bec0cdf..6fe43e024cfaf0 100644 --- a/packages/material-ui/src/test-utils/createMount.js +++ b/packages/material-ui/src/test-utils/createMount.js @@ -24,6 +24,7 @@ class Mode extends React.Component { render() { // Excess props will come from e.g. enzyme setProps + // eslint-disable-next-line @typescript-eslint/naming-convention const { __element, __strict, ...other } = this.props; const Component = __strict ? React.StrictMode : React.Fragment; diff --git a/packages/material-ui/src/test-utils/describeConformance.js b/packages/material-ui/src/test-utils/describeConformance.js index e60a1cca092b7b..1b88b58a8bf36e 100644 --- a/packages/material-ui/src/test-utils/describeConformance.js +++ b/packages/material-ui/src/test-utils/describeConformance.js @@ -1,7 +1,7 @@ import { expect } from 'chai'; import * as React from 'react'; -import findOutermostIntrinsic from './findOutermostIntrinsic'; import ReactTestRenderer from 'react-test-renderer'; +import findOutermostIntrinsic from './findOutermostIntrinsic'; import testRef from './testRef'; /** diff --git a/packages/material-ui/src/utils/index.js b/packages/material-ui/src/utils/index.js index a79c386cfc4104..0c5cddfc7f77ed 100644 --- a/packages/material-ui/src/utils/index.js +++ b/packages/material-ui/src/utils/index.js @@ -12,6 +12,5 @@ export { default as unsupportedProp } from './unsupportedProp'; export { default as useControlled } from './useControlled'; export { default as useEventCallback } from './useEventCallback'; export { default as useForkRef } from './useForkRef'; -// eslint-disable-next-line camelcase export { default as unstable_useId } from './unstable_useId'; export { default as useIsFocusVisible } from './useIsFocusVisible'; diff --git a/packages/material-ui/src/utils/isMuiElement.d.ts b/packages/material-ui/src/utils/isMuiElement.d.ts index bfb5df3b456eef..ffca03d9a690c2 100644 --- a/packages/material-ui/src/utils/isMuiElement.d.ts +++ b/packages/material-ui/src/utils/isMuiElement.d.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StandardProps } from '../'; +import { StandardProps } from '..'; export type NamedMuiComponent = React.ComponentType & { muiName: string }; diff --git a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts b/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts index fed68f6668aa72..2bbe60bcff0f62 100644 --- a/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts +++ b/packages/material-ui/src/withMobileDialog/withMobileDialog.d.ts @@ -1,6 +1,6 @@ +import { PropInjector } from '@material-ui/types'; import { Breakpoint } from '../styles/createBreakpoints'; import { WithWidth } from '../withWidth'; -import { PropInjector } from '@material-ui/types'; export interface WithMobileDialogOptions { breakpoint: Breakpoint; diff --git a/packages/material-ui/src/withWidth/withWidth.d.ts b/packages/material-ui/src/withWidth/withWidth.d.ts index 64669acfd1abc0..7d76ce474a7509 100644 --- a/packages/material-ui/src/withWidth/withWidth.d.ts +++ b/packages/material-ui/src/withWidth/withWidth.d.ts @@ -1,5 +1,5 @@ -import { Breakpoint } from '../styles/createBreakpoints'; import { PropInjector } from '@material-ui/types'; +import { Breakpoint } from '../styles/createBreakpoints'; export interface WithWidthOptions { withTheme?: boolean; diff --git a/packages/material-ui/test/typescript/components.spec.tsx b/packages/material-ui/test/typescript/components.spec.tsx index e41a804807a67b..636b042a9df8cb 100644 --- a/packages/material-ui/test/typescript/components.spec.tsx +++ b/packages/material-ui/test/typescript/components.spec.tsx @@ -215,8 +215,7 @@ const CardTest = () => ( adjective well meaning and kindly. - - {'"a benevolent smile"'} + a benevolent smile @@ -233,7 +232,7 @@ const CardMediaTest = () => ( subheader="September 14, 2016" /> - + @@ -252,7 +251,7 @@ const CardMediaTest = () => ( - + Method: @@ -288,7 +287,7 @@ const ChipsTest = () => ( M} label="Clickable Chip" onClick={(e) => log(e)} /> - } label="Deletable Chip" onDelete={(e) => log(e)} /> + } label="Deletable Chip" onDelete={(e) => log(e)} /> @@ -305,7 +304,7 @@ const ChipsTest = () => ( const DialogTest = () => { const emails = ['username@gmail.com', 'user02@gmail.com']; return ( - log(e)} open> + log(event)} open> Set backup account @@ -399,14 +398,19 @@ const DrawerTest = () => { }; return ( - log(e)} onClick={(e) => log(e)}> + log(event)} + onClick={(e) => log(e)} + > List log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} ModalProps={{ hideBackdrop: true, @@ -418,7 +422,7 @@ const DrawerTest = () => { anchor="bottom" variant="temporary" open={open.bottom} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} > List @@ -427,7 +431,7 @@ const DrawerTest = () => { variant="persistent" anchor="right" open={open.right} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} > List @@ -447,7 +451,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -456,7 +460,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} ModalProps={{ @@ -468,7 +472,7 @@ const SwipeableDrawerTest = () => { log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -478,7 +482,7 @@ const SwipeableDrawerTest = () => { variant="temporary" anchor="right" open={open.right} - onClose={(e) => log(e)} + onClose={(event) => log(event)} onClick={(e) => log(e)} onOpen={(e) => log(e)} > @@ -516,7 +520,7 @@ const GridTest = () => ( ... - + ... @@ -538,7 +542,7 @@ const ListTest = () => ( {[0, 1, 2, 3].map((value) => ( log(e)}> - + @@ -566,8 +570,8 @@ const MenuTest = () => { log(e)} + open + onClose={(event) => log(event)} PopoverClasses={{ paper: 'foo' }} > {options.map((option, index) => ( @@ -691,9 +695,7 @@ const SelectionControlTest = () => { label="Indeterminate" /> - } + control={} label="Custom color" /> @@ -744,9 +746,9 @@ const SnackbarTest = () => ( vertical: 'bottom', horizontal: 'left', }} - open={true} + open autoHideDuration={6000} - onClose={(e) => log(e)} + onClose={(event) => log(event)} ContentProps={ { // 'aria-describedby': 'message-id', @@ -942,9 +944,9 @@ const TabsTest = () => { - {this.state.value === 0 && {'Item One'}} - {this.state.value === 1 && {'Item Two'}} - {this.state.value === 2 && {'Item Three'}} + {this.state.value === 0 && Item One} + {this.state.value === 1 && Item Two} + {this.state.value === 2 && Item Three} ); } @@ -955,15 +957,15 @@ const TabsTest = () => { const TextFieldTest = () => ( - - Name} value={'Alice'} /> + + Name} value="Alice" /> log({ name: event.currentTarget.value })} /> - + ( ); const LinkTest = () => { - const dudUrl = 'javascript:;'; + const dudUrl = 'javascript'; return ( Link - {'color="inherit"'} + inherit - {'variant="body1"'} + body1 ); diff --git a/packages/material-ui/test/typescript/styles.spec.tsx b/packages/material-ui/test/typescript/styles.spec.tsx index 6be0f6dd690aa1..fdc313eaeb1e5b 100644 --- a/packages/material-ui/test/typescript/styles.spec.tsx +++ b/packages/material-ui/test/typescript/styles.spec.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/rules-of-hooks */ import * as React from 'react'; import { createStyles, @@ -164,7 +165,7 @@ const t5 = createMuiTheme().spacing(1, 2, 3, 4, 5); function OverridesTheme() { return ( - {'Overrides'} + Overrides ); } @@ -488,7 +489,7 @@ withStyles((theme) => { // https://github.com/mui-org/material-ui/pull/15546 // Update type definition to let CSS properties be functions - interface testProps { + interface TestProps { foo: boolean; } @@ -496,10 +497,10 @@ withStyles((theme) => { const useStyles = makeStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), }), }); @@ -511,10 +512,10 @@ withStyles((theme) => { const useStyles = makeStyles((theme) => ({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), margin: theme.spacing(1), }), })); @@ -527,10 +528,10 @@ withStyles((theme) => { const styles = createStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), }), }); @@ -542,10 +543,10 @@ withStyles((theme) => { withStyles({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), margin: 8, }), }); @@ -555,10 +556,10 @@ withStyles((theme) => { withStyles((theme) => ({ root: { - width: (prop: testProps) => (prop.foo ? 100 : 0), + width: (prop: TestProps) => (prop.foo ? 100 : 0), }, - root2: (prop2: testProps) => ({ - width: (prop: testProps) => (prop.foo && prop2.foo ? 100 : 0), + root2: (prop2: TestProps) => ({ + width: (prop: TestProps) => (prop.foo && prop2.foo ? 100 : 0), height: theme.spacing(1), }), })); @@ -618,18 +619,18 @@ withStyles((theme) => return { padding: theme.spacing(1) }; }); - interface myProps { + interface MyProps { testValue: boolean; } // Type of props follow all the way to css properties - styled(Button)(({ theme, testValue }) => { + styled(Button)(({ theme, testValue }) => { expectType(theme); expectType(testValue); return { padding: (props) => { - expectType(props); + expectType(props); expectType(props.testValue); return theme.spacing(1); diff --git a/packages/typescript-to-proptypes/test/options-test/options.ts b/packages/typescript-to-proptypes/test/options-test/options.ts index 85f340a76c7db1..0d76f3064bb9b8 100644 --- a/packages/typescript-to-proptypes/test/options-test/options.ts +++ b/packages/typescript-to-proptypes/test/options-test/options.ts @@ -6,6 +6,7 @@ const options: TestOptions = { if (name.endsWith('Props')) { return false; } + return true; }, }, injector: { diff --git a/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts b/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts index 5e9d3028d4404d..d9fddc0e5f9303 100644 --- a/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts +++ b/packages/typescript-to-proptypes/test/overloaded-function-component/input.d.ts @@ -1,4 +1,5 @@ import * as React from 'react'; + interface ButtonProps { variant?: string; } diff --git a/packages/typescript-to-proptypes/test/sort-unions/input.d.ts b/packages/typescript-to-proptypes/test/sort-unions/input.d.ts index 08d90791df5a95..5379600ee91549 100644 --- a/packages/typescript-to-proptypes/test/sort-unions/input.d.ts +++ b/packages/typescript-to-proptypes/test/sort-unions/input.d.ts @@ -1,5 +1,3 @@ -import * as React from 'react'; - type Breakpoint = 'xs' | 'md' | 'xl'; export interface Props { diff --git a/packages/typescript-to-proptypes/test/union-props/input.d.ts b/packages/typescript-to-proptypes/test/union-props/input.d.ts index a4b6a03347078d..551c9bcf1002ff 100644 --- a/packages/typescript-to-proptypes/test/union-props/input.d.ts +++ b/packages/typescript-to-proptypes/test/union-props/input.d.ts @@ -1,5 +1,3 @@ -import * as React from 'react'; - export interface BaseProps { value?: unknown; } diff --git a/scripts/generateProptypes.ts b/scripts/generateProptypes.ts index 37a4728700deae..e4033148770ada 100644 --- a/scripts/generateProptypes.ts +++ b/scripts/generateProptypes.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import * as path from 'path'; import * as fse from 'fs-extra'; import * as ttp from 'typescript-to-proptypes'; @@ -139,6 +140,8 @@ const getSortLiteralUnions: ttp.InjectOptions['getSortLiteralUnions'] = (compone ) { return sortBreakpointsLiteralByViewportAscending; } + + return undefined; }; const tsconfig = ttp.loadConfig(path.resolve(__dirname, '../tsconfig.json')); diff --git a/scripts/listChangedFiles.test.js b/scripts/listChangedFiles.test.js index 24a18d0240856e..5c1360a6e61fdb 100644 --- a/scripts/listChangedFiles.test.js +++ b/scripts/listChangedFiles.test.js @@ -1,8 +1,8 @@ -const listChangedFiles = require('./listChangedFiles'); const fs = require('fs'); const rimraf = require('rimraf'); const { promisify } = require('util'); const { expect } = require('chai'); +const listChangedFiles = require('./listChangedFiles'); const writeFileAsync = promisify(fs.writeFile); const rimrafAsync = promisify(rimraf); diff --git a/test/utils/components.js b/test/utils/components.js index c4ac86bb5590cb..76c47c494ed24a 100644 --- a/test/utils/components.js +++ b/test/utils/components.js @@ -13,7 +13,9 @@ export class ErrorBoundary extends React.Component { children: PropTypes.node.isRequired, }; - state = { error: null }; + state = { + error: null, + }; /** * @public diff --git a/test/utils/createMount.js b/test/utils/createMount.js index 1f9b00453a0f08..fcde56928f558f 100644 --- a/test/utils/createMount.js +++ b/test/utils/createMount.js @@ -28,6 +28,7 @@ class Mode extends React.Component { render() { // Excess props will come from e.g. enzyme setProps + // eslint-disable-next-line @typescript-eslint/naming-convention const { __element, __strict, ...other } = this.props; const Component = __strict ? React.StrictMode : React.Fragment; diff --git a/test/utils/initMatchers.js b/test/utils/initMatchers.js index f7e1e848ab9115..a80d7f19895272 100644 --- a/test/utils/initMatchers.js +++ b/test/utils/initMatchers.js @@ -148,7 +148,7 @@ chai.use((chaiAPI, utils) => { * Correct name for `to.be.visible` */ chai.Assertion.addMethod('toBeVisible', function toBeVisible() { - // eslint-disable-next-line no-underscore-dangle, no-unused-expressions + // eslint-disable-next-line no-underscore-dangle, @typescript-eslint/no-unused-expressions new chai.Assertion(this._obj).to.be.visible; }); }); diff --git a/yarn.lock b/yarn.lock index d84660f8a7fb30..cf256dd121a8b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -344,7 +344,7 @@ resolve "^1.13.1" v8flags "^3.1.1" -"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.10.4", "@babel/parser@^7.7.0", "@babel/parser@^7.7.5": +"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.10.4", "@babel/parser@^7.7.5": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.10.4.tgz#9eedf27e1998d87739fb5028a5120557c06a1a64" integrity sha512-8jHII4hf+YVDsskTF6WuMB3X4Eh+PsUkC2ljq22so5rHvH+T8BzyL94VOdyFLNR8tBSVXOTbNHOKpR4TfRxVtA== @@ -1050,7 +1050,7 @@ "@babel/parser" "^7.10.4" "@babel/types" "^7.10.4" -"@babel/traverse@^7.10.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.4": +"@babel/traverse@^7.10.4", "@babel/traverse@^7.4.5", "@babel/traverse@^7.6.2", "@babel/traverse@^7.7.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.10.4.tgz#e642e5395a3b09cc95c8e74a27432b484b697818" integrity sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q== @@ -1065,7 +1065,7 @@ globals "^11.1.0" lodash "^4.17.13" -"@babel/types@7.8.3", "@babel/types@7.9.6", "@babel/types@^7.0.0", "@babel/types@^7.10.2", "@babel/types@^7.10.4", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.6.1", "@babel/types@^7.7.0": +"@babel/types@7.8.3", "@babel/types@7.9.6", "@babel/types@^7.0.0", "@babel/types@^7.10.2", "@babel/types@^7.10.4", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0", "@babel/types@^7.6.1": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.10.4.tgz#369517188352e18219981efd156bfdb199fff1ee" integrity sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg== @@ -2495,6 +2495,11 @@ "@types/cheerio" "*" "@types/react" "*" +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/eslint@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.0.tgz#eb5c5b575237334df24c53195e37b53d66478d7b" @@ -2565,7 +2570,7 @@ "@types/parse5" "*" "@types/tough-cookie" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.4": +"@types/json-schema@*", "@types/json-schema@^7.0.3", "@types/json-schema@^7.0.4": version "7.0.5" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" integrity sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ== @@ -2822,6 +2827,66 @@ dependencies: "@types/node" "*" +"@typescript-eslint/eslint-plugin@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.0.tgz#ba2b6cae478b8fca3f2e58ff1313e4198eea2d8a" + integrity sha512-ubHlHVt1lsPQB/CZdEov9XuOFhNG9YRC//kuiS1cMQI6Bs1SsqKrEmZnpgRwthGR09/kEDtr9MywlqXyyYd8GA== + dependencies: + "@typescript-eslint/experimental-utils" "3.6.0" + debug "^4.1.1" + functional-red-black-tree "^1.0.1" + regexpp "^3.0.0" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/experimental-utils@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.0.tgz#0138152d66e3e53a6340f606793fb257bf2d76a1" + integrity sha512-4Vdf2hvYMUnTdkCNZu+yYlFtL2v+N2R7JOynIOkFbPjf9o9wQvRwRkzUdWlFd2YiiUwJLbuuLnl5civNg5ykOQ== + dependencies: + "@types/json-schema" "^7.0.3" + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/typescript-estree" "3.6.0" + eslint-scope "^5.0.0" + eslint-utils "^2.0.0" + +"@typescript-eslint/parser@^3.1.0", "@typescript-eslint/parser@^3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.6.0.tgz#79b5232e1a2d06f1fc745942b690cd87aca7b60e" + integrity sha512-taghDxuLhbDAD1U5Fk8vF+MnR0yiFE9Z3v2/bYScFb0N1I9SK8eKHkdJl1DAD48OGFDMFTeOTX0z7g0W6SYUXw== + dependencies: + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "3.6.0" + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/typescript-estree" "3.6.0" + eslint-visitor-keys "^1.1.0" + +"@typescript-eslint/types@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.6.0.tgz#4bd6eee55d2f9d35a4b36c4804be1880bf68f7bc" + integrity sha512-JwVj74ohUSt0ZPG+LZ7hb95fW8DFOqBuR6gE7qzq55KDI3BepqsCtHfBIoa0+Xi1AI7fq5nCu2VQL8z4eYftqg== + +"@typescript-eslint/typescript-estree@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.0.tgz#9b4cab43f1192b64ff51530815b8919f166ce177" + integrity sha512-G57NDSABHjvob7zVV09ehWyD1K6/YUKjz5+AufObFyjNO4DVmKejj47MHjVHHlZZKgmpJD2yyH9lfCXHrPITFg== + dependencies: + "@typescript-eslint/types" "3.6.0" + "@typescript-eslint/visitor-keys" "3.6.0" + debug "^4.1.1" + glob "^7.1.6" + is-glob "^4.0.1" + lodash "^4.17.15" + semver "^7.3.2" + tsutils "^3.17.1" + +"@typescript-eslint/visitor-keys@3.6.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.0.tgz#44185eb0cc47651034faa95c5e2e8b314ecebb26" + integrity sha512-p1izllL2Ubwunite0ITjubuMQRBGgjdVYwyG7lXPX8GbrA6qF0uwSRz9MnXZaHMxID4948gX0Ez8v9tUDi/KfQ== + dependencies: + eslint-visitor-keys "^1.1.0" + "@webassemblyjs/ast@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964" @@ -3659,18 +3724,6 @@ babel-core@^7.0.0-bridge.0: resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" integrity sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg== -babel-eslint@^10.0.3, babel-eslint@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" - integrity sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - eslint-visitor-keys "^1.0.0" - resolve "^1.12.0" - babel-loader@^8.0.0: version "8.1.0" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.1.0.tgz#c611d5112bd5209abe8b9fa84c3e4da25275f1c3" @@ -6787,7 +6840,7 @@ escodegen@^1.14.1: optionalDependencies: source-map "~0.6.1" -eslint-config-airbnb-base@^14.2.0: +eslint-config-airbnb-base@^14.1.0, eslint-config-airbnb-base@^14.2.0: version "14.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz#fe89c24b3f9dc8008c9c0d0d88c28f95ed65e9c4" integrity sha512-Snswd5oC6nJaevs3nZoLSTvGJBvzTfnBqOIArkf3cbyTyq9UD79wOk8s+RiL6bhca0p/eRO6veczhf6A/7Jy8Q== @@ -6796,7 +6849,16 @@ eslint-config-airbnb-base@^14.2.0: object.assign "^4.1.0" object.entries "^1.1.2" -eslint-config-airbnb@^18.2.0: +eslint-config-airbnb-typescript@^8.0.2: + version "8.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-8.0.2.tgz#465b17b0b1facdcca4fe23a5426bc27ab7b2b2f2" + integrity sha512-TCOftyCoIogJzzLGSg0Qlxd27qvf+1a3MHyN/PqynTqINS4iFy+SlXy/CrAN+6xkleGMSrvmPbm3pyFEku2+IQ== + dependencies: + "@typescript-eslint/parser" "^3.1.0" + eslint-config-airbnb "^18.1.0" + eslint-config-airbnb-base "^14.1.0" + +eslint-config-airbnb@^18.1.0: version "18.2.0" resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.0.tgz#8a82168713effce8fc08e10896a63f1235499dcd" integrity sha512-Fz4JIUKkrhO0du2cg5opdyPKQXOI2MvF8KUvN2710nJMT6jaRUpRE2swrJftAjVGL7T1otLM5ieo5RqS1v9Udg== @@ -6930,7 +6992,7 @@ eslint-scope@^4.0.3: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^5.1.0: +eslint-scope@^5.0.0, eslint-scope@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5" integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w== @@ -6945,7 +7007,7 @@ eslint-utils@^2.0.0: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.2.0: +eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== @@ -13653,7 +13715,7 @@ regexp.prototype.flags@^1.3.0: define-properties "^1.1.3" es-abstract "^1.17.0-next.1" -regexpp@^3.1.0: +regexpp@^3.0.0, regexpp@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.1.0.tgz#206d0ad0a5648cffbdb8ae46438f3dc51c9f78e2" integrity sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q== @@ -15716,6 +15778,13 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" +tsutils@^3.17.1: + version "3.17.1" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759" + integrity sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g== + dependencies: + tslib "^1.8.1" + tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"