Skip to content

Commit 7dc84b1

Browse files
committed
[infra] Migrate to use eslint without airbnb config
1 parent 37bc251 commit 7dc84b1

File tree

49 files changed

+719
-949
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+719
-949
lines changed

docs/data/data-grid/server-side-data/ServerSideTreeDataCustomCache.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const cache: GridDataSourceCache = {
4444

4545
const pageSizeOptions = [5, 10, 50];
4646
const dataSetOptions = {
47-
dataSet: 'Employee' as 'Employee',
47+
dataSet: 'Employee' as const,
4848
rowLength: 1000,
4949
treeData: { maxDepth: 3, groupingField: 'name', averageChildren: 5 },
5050
};

docs/data/data-grid/server-side-data/ServerSideTreeDataErrorHandling.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { useMockServer } from '@mui/x-data-grid-generator';
1717
const pageSizeOptions = [5, 10, 50];
1818
const serverOptions = { useCursorPagination: false };
1919
const dataSetOptions = {
20-
dataSet: 'Employee' as 'Employee',
20+
dataSet: 'Employee' as const,
2121
rowLength: 1000,
2222
treeData: { maxDepth: 3, groupingField: 'name', averageChildren: 5 },
2323
};

docs/scripts/api/buildExportsDocumentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const buildPackageExports = (project: XTypeScriptProject) => {
1818
return {
1919
name,
2020
kind: syntaxKindToSyntaxName[
21+
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
2122
resolveExportSpecifier(symbol, project).declarations?.[0].kind!
2223
],
2324
};
@@ -27,7 +28,6 @@ const buildPackageExports = (project: XTypeScriptProject) => {
2728
writePrettifiedFile(
2829
path.resolve(project.workspaceRoot, `scripts/${project.name}.exports.json`),
2930
JSON.stringify(exports),
30-
project,
3131
);
3232
};
3333

docs/src/modules/utils/useCustomizationPlayground.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ interface Props
145145

146146
/* I use this method to parse whatever component props are passed in and format them for the code example,
147147
so the code example includes the same props as the rendered component. e.g. the views={['month']} */
148+
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
148149
function formatComponentProps(componentProps?: Object, spacing: number = 1) {
150+
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
149151
function formatObject(obj: Object, indentLevel = 0, separator = ': '): string {
150152
const indent = ' '.repeat(indentLevel * 2);
151153

docs/src/sw.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
/* eslint-env serviceworker */
22
// https://github.com/airbnb/javascript/issues/1632
3-
/* eslint-disable no-restricted-globals */
43

54
// See https://developer.chrome.com/docs/workbox/remove-buggy-service-workers/
6-
self.addEventListener('install', () => {
5+
globalThis.addEventListener('install', () => {
76
// Skip over the "waiting" lifecycle state, to ensure that our
87
// new service worker is activated immediately, even if there's
98
// another tab open controlled by our older service worker code.
10-
self.skipWaiting();
9+
globalThis.skipWaiting();
1110
});
12-
self.addEventListener('message', () => {
11+
globalThis.addEventListener('message', () => {
1312
// Optional: Get a list of all the current open windows/tabs under
1413
// our service worker's control, and force them to reload.
1514
// This can "unbreak" any open windows/tabs as soon as the new
1615
// service worker activates, rather than users having to manually reload.
17-
self.clients.matchAll({ type: 'window' }).then((windowClients) => {
16+
globalThis.clients.matchAll({ type: 'window' }).then((windowClients) => {
1817
windowClients.forEach((windowClient) => {
1918
windowClient.navigate(windowClient.url);
2019
});

eslint.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ export default defineConfig(
165165
'react/jsx-no-duplicate-props': ['warn', { ignoreCase: false }],
166166
// TODO move to @mui/internal-code-infra/eslint, these are false positive
167167
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
168+
// migration rules
169+
'@typescript-eslint/no-namespace': 'off',
170+
'@typescript-eslint/ban-ts-comment': 'off',
171+
'@typescript-eslint/no-require-imports': 'off',
168172
},
169173
},
170174
// Test start

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"@mui/icons-material": "catalog:",
8080
"@mui/internal-bundle-size-checker": "^1.0.9-canary.18",
8181
"@mui/internal-babel-plugin-display-name": "^1.0.4-canary.3",
82-
"@mui/internal-code-infra": "^0.0.2-canary.32",
82+
"@mui/internal-code-infra": "https://pkg.pr.new/mui/mui-public/@mui/internal-code-infra@d29daf8",
8383
"@mui/internal-markdown": "^2.0.6",
8484
"@mui/internal-test-utils": "catalog:",
8585
"@mui/material": "catalog:",

packages/x-charts-premium/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ export * from '@mui/x-charts-pro/ChartsToolbarPro';
4242

4343
// Premium utilities
4444
export * from './constants';
45+
// eslint-disable-next-line import/export
4546
export * from './hooks';
47+
// eslint-disable-next-line import/export
4648
export * from './context';
49+
// eslint-disable-next-line import/export
4750
export * from './models';
4851
// Locales should be imported from `@mui/x-charts-premium/locales`
4952
// export * from './locales';

packages/x-charts-pro/src/FunnelChart/curves/bump.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable class-methods-use-this */
21
import { FunnelCurveGenerator, CurveOptions, Point } from './curve.types';
32

43
/**

packages/x-charts-pro/src/FunnelChart/curves/linear.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable class-methods-use-this */
21
import { FunnelCurveGenerator, CurveOptions, FunnelPointShape, Point } from './curve.types';
32
import { borderRadiusPolygon } from './borderRadiusPolygon';
43
import { lerpX, lerpY } from './utils';

0 commit comments

Comments
 (0)