Skip to content

Commit d52196b

Browse files
committed
chore: update eslint and typescript-eslint to latest versions
1 parent 3655867 commit d52196b

6 files changed

Lines changed: 1721 additions & 271 deletions

File tree

.eslintrc.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@ module.exports = {
1414
'eslint:recommended',
1515
'plugin:@typescript-eslint/eslint-recommended',
1616
'plugin:react/recommended',
17+
'plugin:react/jsx-runtime',
1718
'plugin:@typescript-eslint/recommended',
1819
'plugin:@typescript-eslint/recommended-requiring-type-checking',
1920
'prettier',
20-
'prettier/@typescript-eslint',
21-
'prettier/react',
2221
],
22+
settings: {
23+
react: {
24+
version: 'detect',
25+
},
26+
},
2327
rules: {
2428
'@typescript-eslint/prefer-regexp-exec': 1,
25-
'@typescript-eslint/ban-ts-ignore': 0,
29+
'@typescript-eslint/ban-ts-comment': 0,
2630
'@typescript-eslint/unbound-method': 1,
31+
'react/prop-types': 0, // Using TypeScript for prop validation
2732
},
33+
ignorePatterns: ['**/*.test.ts', '**/*.test.tsx'],
2834
};

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@
5555
"@types/react-dom": "^18.2.0",
5656
"@types/storybook__react": "^4.0.2",
5757
"@types/throttle-debounce": "^2.1.0",
58-
"@typescript-eslint/eslint-plugin": "^2.3.2",
59-
"@typescript-eslint/parser": "^2.3.2",
58+
"@typescript-eslint/eslint-plugin": "^8.50.1",
59+
"@typescript-eslint/parser": "^8.50.1",
6060
"awesome-typescript-loader": "^5.2.1",
6161
"babel-loader": "^8.0.6",
62-
"eslint": "^6.5.1",
63-
"eslint-config-prettier": "^6.3.0",
64-
"eslint-plugin-react": "^7.15.0",
62+
"eslint": "^8",
63+
"eslint-config-prettier": "^10.1.8",
64+
"eslint-plugin-react": "^7.37.5",
6565
"husky": ">=1",
6666
"jest": "^24.9.0",
6767
"lint-staged": ">=8",

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ export default {
2121
name: 'InfiniteScroll',
2222
},
2323
],
24-
external: [...Object.keys(pkg.peerDependencies || {})],
24+
external: [...Object.keys(pkg.peerDependencies || {}), 'react/jsx-runtime'],
2525
plugins: [resolve(), typescript({ useTsconfigDeclarationDir: true })],
2626
};

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component, ReactNode, CSSProperties } from 'react';
1+
import { Component, ReactNode, CSSProperties } from 'react';
22
import { throttle } from 'throttle-debounce';
33
import { ThresholdUnits, parseThreshold } from './utils/threshold';
44

tsconfig.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
], /* Specify library files to be included in the compilation. */
1010
// "allowJs": true, /* Allow javascript files to be compiled. */
1111
// "checkJs": true, /* Report errors in .js files. */
12-
"jsx": "react-jsx" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
13-
"jsxImportSource": "react",
12+
"jsx": "react-jsx" /* Specify JSX code generation: 'preserve', 'react-native', 'react', or 'react-jsx'. */,
1413
"declaration": true /* Generates corresponding '.d.ts' file. */,
1514
"declarationDir": "./dist",
1615
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
@@ -39,7 +38,7 @@
3938
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
4039
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
4140
/* Module Resolution Options */
42-
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
41+
"moduleResolution": "bundler" /* Specify module resolution strategy: 'bundler', 'node16', 'nodenext', 'node' (deprecated), or 'classic'. */,
4342
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
4443
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
4544
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */

0 commit comments

Comments
 (0)