Skip to content

Commit e69e842

Browse files
committed
CDC #458 - Updating eslint to latest version and fixing errors
1 parent 1a8fc7f commit e69e842

80 files changed

Lines changed: 1946 additions & 1996 deletions

File tree

Some content is hidden

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

.eslintrc.json

Lines changed: 0 additions & 59 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.17.1
1+
24.4.1

babel.config.cjs renamed to babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
plugins: [
33
'transform-flow-strip-types'
44
],

eslint.config.js

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
// @flow
2+
3+
import js from '@eslint/js';
4+
import babelParser from '@babel/eslint-parser';
5+
import flowtype from 'eslint-plugin-flowtype';
6+
import importPlugin from 'eslint-plugin-import';
7+
import jest from 'eslint-plugin-jest';
8+
import jsxA11y from 'eslint-plugin-jsx-a11y';
9+
import react from 'eslint-plugin-react';
10+
import globals from 'globals';
11+
12+
export default [
13+
importPlugin.flatConfigs.recommended,
14+
js.configs.recommended,
15+
react.configs.flat.recommended,
16+
{
17+
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
18+
languageOptions: {
19+
ecmaVersion: 'latest',
20+
globals: {
21+
...globals.browser,
22+
...jest.environments.globals.globals,
23+
__dirname: 'readonly',
24+
Atomics: 'readonly',
25+
JSX: 'readonly',
26+
SharedArrayBuffer: 'readonly',
27+
TimeoutID: 'readonly',
28+
process: 'readonly'
29+
},
30+
parser: babelParser,
31+
parserOptions: {
32+
ecmaFeatures: {
33+
jsx: true
34+
},
35+
requireConfigFile: true,
36+
babelOptions: {
37+
parserOpts: {
38+
plugins: ['jsx']
39+
}
40+
}
41+
},
42+
sourceType: 'module'
43+
},
44+
plugins: {
45+
react,
46+
flowtype,
47+
// import: importPlugin,
48+
jest,
49+
'jsx-a11y': jsxA11y
50+
},
51+
rules: {
52+
'class-methods-use-this': 'off',
53+
'comma-dangle': ['error', 'never'],
54+
"import/no-named-as-default": "off",
55+
'import/no-unresolved': ['error', {
56+
ignore: [
57+
'@samvera/clover-iiif.*',
58+
'@tailwindcss/vite',
59+
'react-map-gl/maplibre'
60+
]
61+
}],
62+
'import/prefer-default-export': 'off',
63+
'jsx-a11y/media-has-caption': 'off',
64+
'jsx-quotes': ['error', 'prefer-single'],
65+
'lines-between-class-members': 'off',
66+
'max-len': ['error', {
67+
code: 120,
68+
ignoreStrings: true
69+
}],
70+
'no-underscore-dangle': 'off',
71+
'no-use-before-define': 'off',
72+
'quote-props': ['error', 'as-needed', {
73+
keywords: false,
74+
unnecessary: true,
75+
numbers: true
76+
}],
77+
'react/display-name': 'off',
78+
'react/default-props-match-prop-types': 'off',
79+
'react/destructuring-assignment': 'off',
80+
'react/jsx-filename-extension': [1, {
81+
extensions: ['.js', '.jsx']
82+
}],
83+
'react/jsx-no-bind': 'off',
84+
'react/jsx-props-no-spreading': 'off',
85+
'react/no-array-index-key': 'off',
86+
'react/no-did-update-set-state': 'off',
87+
'react/prefer-stateless-function': 'off',
88+
'react/require-default-props': 'off',
89+
'react/sort-comp': 'off',
90+
'react/static-property-placement': 'off',
91+
'semi-style': ['error', 'last']
92+
},
93+
settings: {
94+
react: {
95+
version: 'detect'
96+
}
97+
}
98+
}, {
99+
ignores: [
100+
'**/dist/*'
101+
]
102+
}
103+
];

package.json

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,26 @@
1616
"publish-beta": "node --experimental-json-modules ./scripts/publish.js --tag beta"
1717
},
1818
"devDependencies": {
19-
"@babel/core": "^7.25.7",
20-
"@babel/preset-env": "^7.25.7",
21-
"babel-jest": "^29.7.0",
19+
"@babel/core": "^7.28.0",
20+
"@babel/eslint-parser": "^7.28.0",
21+
"@babel/preset-env": "^7.28.0",
22+
"@eslint/compat": "^1.3.1",
23+
"@eslint/eslintrc": "^3.3.1",
24+
"@eslint/js": "^9.31.0",
25+
"babel-eslint": "^10.1.0",
26+
"babel-jest": "^30.0.4",
2227
"babel-plugin-transform-flow-strip-types": "^6.22.0",
23-
"eslint": "^7.1.0",
24-
"eslint-config-airbnb": "^18.1.0",
25-
"eslint-plugin-flowtype": "^5.9.0",
26-
"eslint-plugin-import": "^2.29.1",
27-
"eslint-plugin-jest": "^26.1.4",
28-
"eslint-plugin-jsx-a11y": "^6.2.3",
29-
"eslint-plugin-react": "^7.19.0",
30-
"eslint-plugin-react-hooks": "^4.1.2",
31-
"eslint-plugin-storybook": "^0.5.7",
32-
"flow-bin": "^0.123.0",
28+
"eslint": "^9.31.0",
29+
"eslint-config-airbnb": "^19.0.4",
30+
"eslint-plugin-flowtype": "^8.0.3",
31+
"eslint-plugin-import": "^2.32.0",
32+
"eslint-plugin-jest": "^29.0.1",
33+
"eslint-plugin-jsx-a11y": "^6.10.2",
34+
"eslint-plugin-react": "^7.37.5",
35+
"eslint-plugin-react-hooks": "^5.2.0",
36+
"eslint-plugin-storybook": "^9.0.17",
37+
"flow-bin": "^0.275.0",
38+
"globals": "^16.3.0",
3339
"jest": "^27.5.1",
3440
"minimist": "^1.2.6",
3541
"underscore": "^1.13.4"

packages/controlled-vocabulary/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/controlled-vocabulary/src/i18n/i18n.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22

3-
import i18next from 'i18next';
3+
import { createInstance } from 'i18next';
44

55
import en from './en.json';
66

@@ -10,15 +10,15 @@ const resources = {
1010
}
1111
};
1212

13-
const i18n = i18next.createInstance();
13+
const i18n = createInstance();
1414

1515
i18n
1616
.init({
1717
debug: true,
1818
fallbackLng: 'en',
1919
lng: 'en',
2020
interpolation: {
21-
escapeValue: false,
21+
escapeValue: false
2222
},
2323
resources
2424
});

packages/controlled-vocabulary/vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default defineConfig(() => ({
99
esbuild: {
1010
include: /\.js$/,
1111
exclude: [],
12-
loader: 'jsx',
12+
loader: 'jsx'
1313
},
1414
optimizeDeps: {
1515
esbuildOptions: {

packages/core-data/src/components/AccordionItemsList.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,10 @@ const AccordionItemsList = (props: Props) => (
8585
relation.renderItem ? (
8686
relation.renderItem(item)
8787
) : (
88-
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
8988
<li
9089
key={idxx}
9190
onClick={item.onClick}
9291
onKeyDown={item.onClick}
93-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
9492
tabIndex={item.onClick ? '0' : '-1'}
9593
className={
9694
clsx(

packages/core-data/src/components/Checkbox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const Checkbox = (props: Props) => (
4040
checked={props.checked}
4141
className={clsx(
4242
'rounded-sm hover:bg-transparent',
43-
props.className,
43+
props.className
4444
)}
4545
disabled={props.disabled}
4646
id={props.id}
@@ -50,7 +50,7 @@ const Checkbox = (props: Props) => (
5050
<Icon
5151
className={clsx(
5252
{ 'fill-primary': props.checked },
53-
{ 'fill-black': !props.checked },
53+
{ 'fill-black': !props.checked }
5454
)}
5555
name={props.checked ? 'checkbox_filled' : 'checkbox'}
5656
/>

0 commit comments

Comments
 (0)