Skip to content

Commit

Permalink
chore(deps): upgrade to @edx/eslint-config 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Oct 4, 2024
1 parent 020ae21 commit e3b5a1f
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 33 deletions.
15 changes: 4 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const path = require('path');
module.exports = {
extends: [
'@edx/eslint-config',
'plugin:import/typescript',
],
parser: '@babel/eslint-parser',
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
requireConfigFile: true,
babelOptions: {
Expand All @@ -30,7 +30,9 @@ module.exports = {
'**/*.stories.jsx',
'src/setupTest.ts',
'**/*.test.jsx',
'**/*.test.tsx',
'**/*.test.js',
'**/*.test.ts',
'config/*.js',
'*.config.ts',
'*.config.*.js',
Expand Down Expand Up @@ -62,13 +64,4 @@ module.exports = {
globals: {
newrelic: false,
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: 'airbnb-typescript',
parserOptions: {
project: './tsconfig.json',
},
},
],
};
43 changes: 37 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"@babel/preset-env": "^7.16.8",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@edx/eslint-config": "^3.2.0",
"@edx/eslint-config": "^4.2.0",
"@edx/stylelint-config-edx": "^2.3.0",
"@edx/typescript-config": "^1.0.1",
"@formatjs/cli": "^5.0.2",
Expand Down
14 changes: 7 additions & 7 deletions src/DataTable/selection/tests/ControlledSelectHeader.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ import DataTableContext from '../../DataTableContext';
import * as selectActions from '../data/actions';
import { getRowIds } from '../data/helpers';

function DataTableContextChild() {
const contextValue = useContext(DataTableContext);
return (
<div className="context-value" data-contextvalue={contextValue} />
);
}

// eslint-disable-next-line react/prop-types
function ControlledSelectHeaderWrapper({ tableProps, selectProps, ...rest }) {
return (
Expand All @@ -18,13 +25,6 @@ function ControlledSelectHeaderWrapper({ tableProps, selectProps, ...rest }) {
);
}

function DataTableContextChild() {
const contextValue = useContext(DataTableContext);
return (
<div className="context-value" data-contextvalue={contextValue} />
);
}

const mockToggleAllPageRowsSelectedProps = jest.fn();
const rows = [{ id: 1 }, { id: 2 }];
const tableProps = {
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions src/hooks/useArrowKeyNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ function handleArrowKey({ event, currentIndex, availableElements }) {
[nextElement] = availableElements;
}

// eslint-disable-next-line no-unused-expressions
nextElement && nextElement.focus();
nextElement?.focus();
event.preventDefault();
}

Expand Down
4 changes: 3 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"compilerOptions": {
// For build purposes, we use TypeScript/tsc to generate the .d.ts files and Babel to convert .tsx/.ts/.jsx to .js
// In the future we could probably just use tsc for both though.
"emitDeclarationOnly": true
"emitDeclarationOnly": true,
"rootDir": "src"
},
"include": ["src"],
// Don't include the .test.tsx files when we build the .d.ts files in dist/
"exclude": ["src/**/*.test.tsx"],
}
12 changes: 10 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
"compilerOptions": {
"noImplicitAny": true,
"allowJs": false,
"rootDir": "src",
"outDir": "dist"
},
"include": ["src"]
"include": [
"lib/**/*",
"src/**/*",
"*.js",
".eslintrc.js",
"__mocks__/*",
"algolia-docsearch/*",
"bin/*",
"dependent-usage-analyzer/**/*"
]
}
2 changes: 1 addition & 1 deletion www/src/components/LeaveFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { AnchorHTMLAttributes } from 'react';
import PropTypes from 'prop-types';
import { useLocation } from '@reach/router';
import { useLocation } from '@gatsbyjs/reach-router';
import { Nav, Button, Hyperlink } from '~paragon-react';
import { LEAVE_FEEDBACK_CLICKED_EVENT, sendUserAnalyticsEvent } from '../../segment-events';

Expand Down
2 changes: 1 addition & 1 deletion www/src/components/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useContext } from 'react';
import { useLocation } from '@reach/router';
import { useLocation } from '@gatsbyjs/reach-router';
import PropTypes from 'prop-types';
import { Link, graphql, useStaticQuery } from 'gatsby';
import classNames from 'classnames';
Expand Down
2 changes: 1 addition & 1 deletion www/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"~paragon-icons": ["../icons"],
}
},
"include": ["src"]
"include": ["src", "playroom", "utils", "netlify", ".eslintrc.js", "*.js", "*.ts", "*.jsx", "*.tsx"]
}

0 comments on commit e3b5a1f

Please sign in to comment.