Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade eslint #6738

Merged
merged 10 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/src/modules/components/ApiDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const SecondaryHeading = styled(Typography)(({ theme }) => ({
},
}));

const PlanIcon = ({ plan }) => {
function PlanIcon({ plan }) {
let href;
let title;

Expand All @@ -53,13 +53,13 @@ const PlanIcon = ({ plan }) => {
<span className={`plan-${plan}`} title={title} />
</a>
);
};
}

PlanIcon.propTypes = {
plan: PropTypes.string,
};

const ApiProperty = ({ index, property, plan }) => {
function ApiProperty({ index, property, plan }) {
return (
<Accordion>
<AccordionSummary
Expand Down Expand Up @@ -91,7 +91,7 @@ const ApiProperty = ({ index, property, plan }) => {
</AccordionDetails>
</Accordion>
);
};
}

ApiProperty.propTypes = {
index: PropTypes.number.isRequired,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@
"danger": "^11.2.0",
"enzyme": "^3.11.0",
"eslint": "^8.28.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-filenames": "^1.3.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export const getGroupingRules = ({
* Compares two sets of grouping rules to determine if they are equal or not.
*/
export const areGroupingRulesEqual = (
previousValue: GridGroupingRules = [],
previousValue: GridGroupingRules,
newValue: GridGroupingRules,
) => {
if (previousValue.length !== newValue.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ export const useGridRowGrouping = (
GridEventListener<'columnsChange'>
>(() => {
const sanitizedRowGroupingModel = gridRowGroupingSanitizedModelSelector(apiRef);
const rulesOnLastRowTreeCreation = apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation;
const rulesOnLastRowTreeCreation =
apiRef.current.caches.rowGrouping.rulesOnLastRowTreeCreation || [];

const groupingRules = getGroupingRules({
sanitizedRowGroupingModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ describe('<DataGridPro /> - Columns', () => {
type GridPrivateApiContextRef = ReturnType<typeof useGridPrivateApiContext>;
it('should not loose column width when re-applying pipe processing', () => {
let privateApi: GridPrivateApiContextRef;
const Footer = () => {
function Footer() {
privateApi = useGridPrivateApiContext();
return null;
};
}
render(<Test checkboxSelection components={{ Footer }} />);

act(() => apiRef.current.setColumnWidth('brand', 300));
Expand All @@ -365,10 +365,10 @@ describe('<DataGridPro /> - Columns', () => {

it('should not loose column index when re-applying pipe processing', () => {
let privateApi: GridPrivateApiContextRef;
const Footer = () => {
function Footer() {
privateApi = useGridPrivateApiContext();
return null;
};
}
render(
<Test
checkboxSelection
Expand All @@ -386,10 +386,10 @@ describe('<DataGridPro /> - Columns', () => {

it('should not loose imperatively added columns when re-applying pipe processing', () => {
let privateApi: GridPrivateApiContextRef;
const Footer = () => {
function Footer() {
privateApi = useGridPrivateApiContext();
return null;
};
}
render(<Test checkboxSelection components={{ Footer }} />);

act(() => apiRef.current.updateColumns([{ field: 'id' }]));
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers/src/TimeClock/TimeClock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export const TimeClock = React.forwardRef(function TimeClock<TDate extends unkno
components,
componentsProps,
value,
disableIgnoringDatePartForTimeValidation,
disableIgnoringDatePartForTimeValidation = false,
maxTime,
minTime,
disableFuture,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const validateTime: Validator<
maxTime,
minutesStep,
shouldDisableTime,
disableIgnoringDatePartForTimeValidation,
disableIgnoringDatePartForTimeValidation = false,
disablePast,
disableFuture,
} = props;
Expand Down
5 changes: 1 addition & 4 deletions packages/x-date-pickers/src/internals/utils/time-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export const getSecondsInDay = <TDate>(date: TDate, utils: MuiPickersAdapter<TDa
};

export const createIsAfterIgnoreDatePart =
<TDate>(
disableIgnoringDatePartForTimeValidation: boolean = false,
utils: MuiPickersAdapter<TDate>,
) =>
<TDate>(disableIgnoringDatePartForTimeValidation: boolean, utils: MuiPickersAdapter<TDate>) =>
(dateLeft: TDate, dateRight: TDate) => {
if (disableIgnoringDatePartForTimeValidation) {
return utils.isAfter(dateLeft, dateRight);
Expand Down
4 changes: 1 addition & 3 deletions test/utils/mochaHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LicenseInfo } from '@mui/x-license-pro';
import { unstable_resetCleanupTracking } from '@mui/x-data-grid';
import { unstable_resetCleanupTracking as unstable_resetCleanupTrackingPro } from '@mui/x-data-grid-pro';

function createXMochaHooks(coreMochaHooks = {}) {
export function createXMochaHooks(coreMochaHooks = {}) {
const mochaHooks = {
beforeAll: [...(coreMochaHooks.beforeAll ?? [])],
afterAll: [...(coreMochaHooks.afterAll ?? [])],
Expand All @@ -30,5 +30,3 @@ function createXMochaHooks(coreMochaHooks = {}) {

return mochaHooks;
}

module.exports = { createXMochaHooks };
99 changes: 27 additions & 72 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2443,7 +2443,7 @@

"@mui/monorepo@https://github.com/mui/material-ui.git#master":
version "5.10.14"
resolved "https://github.com/mui/material-ui.git#2f27c2eafdf04f278c94a483b76ca6ec925903e9"
resolved "https://github.com/mui/material-ui.git#8bd75c8414334cf377d499f4a6e07e2cdd99d4e3"

"@mui/private-theming@^5.10.14", "@mui/private-theming@^5.10.9":
version "5.10.14"
Expand Down Expand Up @@ -3621,16 +3621,6 @@
dependencies:
"@typescript-eslint/utils" "5.43.0"

"@typescript-eslint/parser@^4.4.1":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.33.0.tgz#dfe797570d9694e560528d18eecad86c8c744899"
integrity sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==
dependencies:
"@typescript-eslint/scope-manager" "4.33.0"
"@typescript-eslint/types" "4.33.0"
"@typescript-eslint/typescript-estree" "4.33.0"
debug "^4.3.1"

"@typescript-eslint/parser@^5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.43.0.tgz#9c86581234b88f2ba406f0b99a274a91c11630fd"
Expand All @@ -3641,14 +3631,6 @@
"@typescript-eslint/typescript-estree" "5.43.0"
debug "^4.3.4"

"@typescript-eslint/scope-manager@4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz#d38e49280d983e8772e29121cf8c6e9221f280a3"
integrity sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==
dependencies:
"@typescript-eslint/types" "4.33.0"
"@typescript-eslint/visitor-keys" "4.33.0"

"@typescript-eslint/scope-manager@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.43.0.tgz#566e46303392014d5d163704724872e1f2dd3c15"
Expand All @@ -3667,29 +3649,11 @@
debug "^4.3.4"
tsutils "^3.21.0"

"@typescript-eslint/types@4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72"
integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==

"@typescript-eslint/types@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.43.0.tgz#e4ddd7846fcbc074325293515fa98e844d8d2578"
integrity sha512-jpsbcD0x6AUvV7tyOlyvon0aUsQpF8W+7TpJntfCUWU1qaIKu2K34pMwQKSzQH8ORgUrGYY6pVIh1Pi8TNeteg==

"@typescript-eslint/typescript-estree@4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609"
integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==
dependencies:
"@typescript-eslint/types" "4.33.0"
"@typescript-eslint/visitor-keys" "4.33.0"
debug "^4.3.1"
globby "^11.0.3"
is-glob "^4.0.1"
semver "^7.3.5"
tsutils "^3.21.0"

"@typescript-eslint/typescript-estree@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.43.0.tgz#b6883e58ba236a602c334be116bfc00b58b3b9f2"
Expand Down Expand Up @@ -3717,14 +3681,6 @@
eslint-utils "^3.0.0"
semver "^7.3.7"

"@typescript-eslint/visitor-keys@4.33.0":
version "4.33.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd"
integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==
dependencies:
"@typescript-eslint/types" "4.33.0"
eslint-visitor-keys "^2.0.0"

"@typescript-eslint/visitor-keys@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.43.0.tgz#cbbdadfdfea385310a20a962afda728ea106befa"
Expand Down Expand Up @@ -5695,10 +5651,10 @@ config-chain@^1.1.12:
ini "^1.3.4"
proto-list "~1.2.1"

confusing-browser-globals@^1.0.9:
version "1.0.9"
resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz#72bc13b483c0276801681871d4898516f8f54fdd"
integrity sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==
confusing-browser-globals@^1.0.10:
version "1.0.11"
resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81"
integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==

connect@^3.7.0:
version "3.7.0"
Expand Down Expand Up @@ -6289,7 +6245,7 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9:
dependencies:
ms "2.0.0"

debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2:
debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
Expand Down Expand Up @@ -6970,32 +6926,31 @@ escodegen@^2.0.0:
optionalDependencies:
source-map "~0.6.1"

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==
eslint-config-airbnb-base@^15.0.0:
version "15.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz#6b09add90ac79c2f8d723a2580e07f3925afd236"
integrity sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==
dependencies:
confusing-browser-globals "^1.0.9"
object.assign "^4.1.0"
object.entries "^1.1.2"
confusing-browser-globals "^1.0.10"
object.assign "^4.1.2"
object.entries "^1.1.5"
semver "^6.3.0"

eslint-config-airbnb-typescript@^12.3.1:
version "12.3.1"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-12.3.1.tgz#83ab40d76402c208eb08516260d1d6fac8f8acbc"
integrity sha512-ql/Pe6/hppYuRp4m3iPaHJqkBB7dgeEmGPQ6X0UNmrQOfTF+dXw29/ZjU2kQ6RDoLxaxOA+Xqv07Vbef6oVTWw==
eslint-config-airbnb-typescript@^17.0.0:
version "17.0.0"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-17.0.0.tgz#360dbcf810b26bbcf2ff716198465775f1c49a07"
integrity sha512-elNiuzD0kPAPTXjFWg+lE24nMdHMtuxgYoD30OyMD6yrW1AhFZPAg27VX7d3tzOErw+dgJTNWfRSDqEcXb4V0g==
dependencies:
"@typescript-eslint/parser" "^4.4.1"
eslint-config-airbnb "^18.2.0"
eslint-config-airbnb-base "^14.2.0"
eslint-config-airbnb-base "^15.0.0"

eslint-config-airbnb@^18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.2.0.tgz#8a82168713effce8fc08e10896a63f1235499dcd"
integrity sha512-Fz4JIUKkrhO0du2cg5opdyPKQXOI2MvF8KUvN2710nJMT6jaRUpRE2swrJftAjVGL7T1otLM5ieo5RqS1v9Udg==
eslint-config-airbnb@^19.0.4:
version "19.0.4"
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-19.0.4.tgz#84d4c3490ad70a0ffa571138ebcdea6ab085fdc3"
integrity sha512-T75QYQVQX57jiNgpF9r1KegMICE94VYwoFQyMGhrvc+lB8YF2E/M/PYDaQe1AJcWaEgqLE+ErXV1Og/+6Vyzew==
dependencies:
eslint-config-airbnb-base "^14.2.0"
object.assign "^4.1.0"
object.entries "^1.1.2"
eslint-config-airbnb-base "^15.0.0"
object.assign "^4.1.2"
object.entries "^1.1.5"

eslint-config-prettier@^8.5.0:
version "8.5.0"
Expand Down Expand Up @@ -8108,7 +8063,7 @@ globby@13.1.2, globby@^13.1.1, globby@^13.1.2:
merge2 "^1.4.1"
slash "^4.0.0"

globby@^11.0.2, globby@^11.0.3, globby@^11.1.0:
globby@^11.0.2, globby@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
Expand Down