Skip to content

Commit 33e47ed

Browse files
committed
Use custom linting
1 parent d053aa6 commit 33e47ed

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

.eslintrc.cjs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
module.exports = {
2-
extends: 'airbnb',
2+
extends: [
3+
'eslint:recommended',
4+
'plugin:import/recommended',
5+
'plugin:react/recommended',
6+
'plugin:react-hooks/recommended',
7+
'plugin:jsx-a11y/recommended',
8+
],
9+
plugins: [
10+
'import',
11+
'react',
12+
'react-hooks',
13+
'jsx-a11y',
14+
],
15+
16+
env: {
17+
es6: true,
18+
browser: true,
19+
},
20+
321
parserOptions: {
422
ecmaVersion: 2022,
523
sourceType: 'module',
@@ -24,7 +42,10 @@ module.exports = {
2442
overrides: [
2543
{
2644
files: ['**/*.ts', '**/*.tsx'],
27-
extends: ['airbnb-typescript'],
45+
extends: ['plugin:@typescript-eslint/recommended'],
46+
plugins: [
47+
'@typescript-eslint',
48+
],
2849
parserOptions: {
2950
project: './tsconfig.json',
3051
},

example/app.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ const videos = [
99
{ id: 169408731, name: 'Hoody - Like You' },
1010
];
1111

12+
type Props = Record<never, never>;
1213
interface State {
1314
videoIndex: number,
1415
volume: number,
1516
paused: boolean,
1617
}
1718

18-
class App extends React.Component<{}, State> {
19-
constructor(props: {}) {
19+
class App extends React.Component<Props, State> {
20+
constructor(props: Props) {
2021
super(props);
2122

2223
this.state = {
@@ -68,6 +69,7 @@ class App extends React.Component<{}, State> {
6869
<div className="collection">
6970
{videos.map((choice, index) => (
7071
<a
72+
key={choice.id}
7173
href={`#!/video/${index}`}
7274
className={`collection-item ${video === choice ? 'active' : ''}`}
7375
onClick={() => this.selectVideo(index)}

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
"@typescript-eslint/parser": "^6.13.2",
5858
"@u-wave/react-vimeo-example": "file:example",
5959
"eslint": "^8.2.0",
60-
"eslint-config-airbnb": "^19.0.0",
61-
"eslint-config-airbnb-typescript": "^17.0.0",
6260
"eslint-plugin-import": "^2.25.3",
6361
"eslint-plugin-jsx-a11y": "^6.5.1",
6462
"eslint-plugin-react": "^7.27.0",

test/index.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* global globalThis */
12
import {
23
describe, it, expect, vi,
34
} from 'vitest';

0 commit comments

Comments
 (0)