Skip to content

Commit e3b5a1f

Browse files
chore(deps): upgrade to @edx/eslint-config 4.2
1 parent 020ae21 commit e3b5a1f

11 files changed

+66
-33
lines changed

.eslintrc.js

+4-11
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ const path = require('path');
33
module.exports = {
44
extends: [
55
'@edx/eslint-config',
6-
'plugin:import/typescript',
76
],
8-
parser: '@babel/eslint-parser',
7+
plugins: ['@typescript-eslint'],
8+
parser: '@typescript-eslint/parser',
99
parserOptions: {
1010
requireConfigFile: true,
1111
babelOptions: {
@@ -30,7 +30,9 @@ module.exports = {
3030
'**/*.stories.jsx',
3131
'src/setupTest.ts',
3232
'**/*.test.jsx',
33+
'**/*.test.tsx',
3334
'**/*.test.js',
35+
'**/*.test.ts',
3436
'config/*.js',
3537
'*.config.ts',
3638
'*.config.*.js',
@@ -62,13 +64,4 @@ module.exports = {
6264
globals: {
6365
newrelic: false,
6466
},
65-
overrides: [
66-
{
67-
files: ['**/*.ts', '**/*.tsx'],
68-
extends: 'airbnb-typescript',
69-
parserOptions: {
70-
project: './tsconfig.json',
71-
},
72-
},
73-
],
7467
};

package-lock.json

+37-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"@babel/preset-env": "^7.16.8",
9696
"@babel/preset-react": "^7.16.7",
9797
"@babel/preset-typescript": "^7.16.7",
98-
"@edx/eslint-config": "^3.2.0",
98+
"@edx/eslint-config": "^4.2.0",
9999
"@edx/stylelint-config-edx": "^2.3.0",
100100
"@edx/typescript-config": "^1.0.1",
101101
"@formatjs/cli": "^5.0.2",

src/DataTable/selection/tests/ControlledSelectHeader.test.jsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ import DataTableContext from '../../DataTableContext';
88
import * as selectActions from '../data/actions';
99
import { getRowIds } from '../data/helpers';
1010

11+
function DataTableContextChild() {
12+
const contextValue = useContext(DataTableContext);
13+
return (
14+
<div className="context-value" data-contextvalue={contextValue} />
15+
);
16+
}
17+
1118
// eslint-disable-next-line react/prop-types
1219
function ControlledSelectHeaderWrapper({ tableProps, selectProps, ...rest }) {
1320
return (
@@ -18,13 +25,6 @@ function ControlledSelectHeaderWrapper({ tableProps, selectProps, ...rest }) {
1825
);
1926
}
2027

21-
function DataTableContextChild() {
22-
const contextValue = useContext(DataTableContext);
23-
return (
24-
<div className="context-value" data-contextvalue={contextValue} />
25-
);
26-
}
27-
2828
const mockToggleAllPageRowsSelectedProps = jest.fn();
2929
const rows = [{ id: 1 }, { id: 2 }];
3030
const tableProps = {
File renamed without changes.

src/hooks/useArrowKeyNavigation.jsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ function handleArrowKey({ event, currentIndex, availableElements }) {
3232
[nextElement] = availableElements;
3333
}
3434

35-
// eslint-disable-next-line no-unused-expressions
36-
nextElement && nextElement.focus();
35+
nextElement?.focus();
3736
event.preventDefault();
3837
}
3938

tsconfig.build.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
"compilerOptions": {
44
// For build purposes, we use TypeScript/tsc to generate the .d.ts files and Babel to convert .tsx/.ts/.jsx to .js
55
// In the future we could probably just use tsc for both though.
6-
"emitDeclarationOnly": true
6+
"emitDeclarationOnly": true,
7+
"rootDir": "src"
78
},
9+
"include": ["src"],
810
// Don't include the .test.tsx files when we build the .d.ts files in dist/
911
"exclude": ["src/**/*.test.tsx"],
1012
}

tsconfig.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
"compilerOptions": {
44
"noImplicitAny": true,
55
"allowJs": false,
6-
"rootDir": "src",
76
"outDir": "dist"
87
},
9-
"include": ["src"]
8+
"include": [
9+
"lib/**/*",
10+
"src/**/*",
11+
"*.js",
12+
".eslintrc.js",
13+
"__mocks__/*",
14+
"algolia-docsearch/*",
15+
"bin/*",
16+
"dependent-usage-analyzer/**/*"
17+
]
1018
}

www/src/components/LeaveFeedback.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { AnchorHTMLAttributes } from 'react';
22
import PropTypes from 'prop-types';
3-
import { useLocation } from '@reach/router';
3+
import { useLocation } from '@gatsbyjs/reach-router';
44
import { Nav, Button, Hyperlink } from '~paragon-react';
55
import { LEAVE_FEEDBACK_CLICKED_EVENT, sendUserAnalyticsEvent } from '../../segment-events';
66

www/src/components/Menu.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useContext } from 'react';
2-
import { useLocation } from '@reach/router';
2+
import { useLocation } from '@gatsbyjs/reach-router';
33
import PropTypes from 'prop-types';
44
import { Link, graphql, useStaticQuery } from 'gatsby';
55
import classNames from 'classnames';

www/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"~paragon-icons": ["../icons"],
1111
}
1212
},
13-
"include": ["src"]
13+
"include": ["src", "playroom", "utils", "netlify", ".eslintrc.js", "*.js", "*.ts", "*.jsx", "*.tsx"]
1414
}

0 commit comments

Comments
 (0)