Skip to content

Commit 8e73bb0

Browse files
authored
chore: Upgrades ESLint version (#102)
1 parent 3df5b77 commit 8e73bb0

File tree

33 files changed

+2595
-1496
lines changed

33 files changed

+2595
-1496
lines changed

.eslintrc

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

eslint.config.mjs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { includeIgnoreFile } from '@eslint/compat';
5+
import eslint from '@eslint/js';
6+
import headerPlugin from 'eslint-plugin-header';
7+
import eslintPrettier from 'eslint-plugin-prettier/recommended';
8+
import reactPlugin from 'eslint-plugin-react';
9+
import unicornPlugin from 'eslint-plugin-unicorn';
10+
import globals from 'globals';
11+
import path from 'node:path';
12+
import tsEslint from 'typescript-eslint';
13+
14+
// https://github.com/Stuk/eslint-plugin-header/issues/57
15+
headerPlugin.rules.header.meta.schema = false;
16+
17+
export default tsEslint.config(
18+
includeIgnoreFile(path.resolve('.gitignore')),
19+
{
20+
settings: {
21+
react: { version: 'detect' },
22+
},
23+
},
24+
eslint.configs.recommended,
25+
tsEslint.configs.recommended,
26+
reactPlugin.configs.flat.recommended,
27+
eslintPrettier,
28+
{
29+
files: ['**/*.{js,mjs,ts,tsx}'],
30+
languageOptions: {
31+
globals: {
32+
...globals.browser,
33+
},
34+
},
35+
plugins: {
36+
unicorn: unicornPlugin,
37+
header: headerPlugin,
38+
},
39+
rules: {
40+
'@typescript-eslint/no-unused-vars': 'off',
41+
'@typescript-eslint/no-explicit-any': 'off',
42+
'@typescript-eslint/no-empty-object-type': 'off',
43+
'@typescript-eslint/no-empty-function': 'off',
44+
'@typescript-eslint/no-namespace': 'off',
45+
'header/header': [
46+
'error',
47+
'line',
48+
[' Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.', ' SPDX-License-Identifier: Apache-2.0'],
49+
],
50+
'no-warning-comments': 'warn',
51+
'react/display-name': 'off',
52+
},
53+
},
54+
);
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
54
export interface ComponentProps {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
34
const a: number = '123';

fixtures/components/forward-ref-parameterized/focusable/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
34
import * as React from 'react';
45

56
interface FocusableForwardRefType {
@@ -31,7 +32,7 @@ const Focusable = React.forwardRef(
3132
focus(rowIndex: number) {},
3233
}));
3334
return <button>Test</button>;
34-
}
35+
},
3536
) as FocusableForwardRefType;
3637

3738
export default Focusable;

fixtures/components/forward-ref/focusable/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
34
import * as React from 'react';
45

56
export interface FocusableProps {
@@ -43,7 +44,7 @@ export namespace FocusableProps {
4344
const Focusable = React.forwardRef(
4445
({ children, type = 'text', count = 123, enabled = true }: FocusableProps, ref: React.Ref<FocusableProps.Ref>) => {
4546
return <button ref={ref}>Test</button>;
46-
}
47+
},
4748
);
4849

4950
export default Focusable;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
34
export type NonCancelableEventHandler<Detail = Record<string, never>> = (event: any) => void;
45
export type CancelableEventHandler<Detail = Record<string, never>> = (event: any) => void;

fixtures/components/system-tag/tree/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33
import * as React from 'react';
44

5-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
65
export interface TreeProps {}
76

87
/**

fixtures/components/unknown-event-handler/button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export interface ButtonProps {
77
}
88

99
export default function Button({ onClick }: ButtonProps) {
10-
return <button />;
10+
return <button onClick={() => onClick} />;
1111
}

fixtures/components/with-internals/with-internals/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
3+
34
import * as React from 'react';
45
import Internal from './internal';
56

@@ -10,7 +11,6 @@ function InternalSameFile() {
1011
return <Internal name="test" />;
1112
}
1213

13-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
1414
export interface WithInternalsProps {
1515
// nothing here
1616
}

0 commit comments

Comments
 (0)