-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patheslint.config.mjs
47 lines (45 loc) · 1.49 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import path from 'node:path';
import eslint from '@eslint/js';
import { includeIgnoreFile } from '@eslint/compat';
import tseslint from 'typescript-eslint';
import eslintPrettier from 'eslint-plugin-prettier/recommended';
import unicornPlugin from 'eslint-plugin-unicorn';
import headerPlugin from 'eslint-plugin-header';
// https://github.com/Stuk/eslint-plugin-header/issues/57
headerPlugin.rules.header.meta.schema = false;
export default tseslint.config(
includeIgnoreFile(path.resolve('.gitignore')),
eslint.configs.recommended,
tseslint.configs.recommended,
eslintPrettier,
{
files: ['**/*.{js,mjs,ts}'],
languageOptions: {
globals: {
console: true,
},
},
plugins: {
unicorn: unicornPlugin,
header: headerPlugin,
},
rules: {
'@typescript-eslint/ban-ts-comment': ['error', { 'ts-expect-error': 'allow-with-description' }],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'unicorn/filename-case': 'error',
curly: 'error',
eqeqeq: 'error',
'no-return-await': 'error',
'require-await': 'error',
'header/header': [
'error',
'line',
[' Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.', ' SPDX-License-Identifier: Apache-2.0'],
],
},
},
);