Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 0 additions & 52 deletions .eslintrc

This file was deleted.

62 changes: 62 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import { includeIgnoreFile } from '@eslint/compat';
import eslint from '@eslint/js';
import headerPlugin from 'eslint-plugin-header';
import eslintPrettier from 'eslint-plugin-prettier/recommended';
import unicornPlugin from 'eslint-plugin-unicorn';
import globals from 'globals';
import path from 'node:path';
import tsEslint from 'typescript-eslint';

// https://github.com/Stuk/eslint-plugin-header/issues/57
headerPlugin.rules.header.meta.schema = false;

export default tsEslint.config(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used eslint config from components as a baseline, but kept the rules to the minimum.

includeIgnoreFile(path.resolve('.gitignore')),
eslint.configs.recommended,
tsEslint.configs.recommended,
eslintPrettier,
{
files: ['**/*.{js,mjs,ts,tsx}'],
languageOptions: {
globals: {
...globals.browser,
},
},
plugins: { unicorn: unicornPlugin, header: headerPlugin },
rules: {
'@typescript-eslint/no-var-requires': 'off',
'header/header': [
'error',
'line',
[' Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.', ' SPDX-License-Identifier: Apache-2.0'],
],
},
},
{
files: ['.github/**', 'scripts/**', '*.mjs', 'test/*.mjs'],
languageOptions: {
globals: {
...globals.node,
...globals.commonjs,
},
},
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['src/**'],
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
},
},
{
files: ['src/**/__tests__/**/*.*js'],
rules: {
'no-undef': 'warn',
},
},
);
Loading
Loading