Skip to content

Commit

Permalink
chore(eslint): update ESLint configuration to flat config (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan000 authored Jan 20, 2025
1 parent 5ca3dce commit 22fc877
Show file tree
Hide file tree
Showing 8 changed files with 3,355 additions and 2,774 deletions.
56 changes: 56 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import tsDocPlugin from 'eslint-plugin-tsdoc';
import stylisticTs from '@stylistic/eslint-plugin-ts';
import pluginJest from 'eslint-plugin-jest';

export default [
{
ignores: ['docs', 'node_modules', 'dist', 'coverage'],
},
{
plugins: {
'@typescript-eslint': typescriptPlugin,
'@stylistic/ts': stylisticTs,
'jest': pluginJest,
'tsdoc': tsDocPlugin,
},
},
{
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
},
{
files: ['**/*.ts', '**/*.tsx'],
rules: {
'capitalized-comments': ['warn', 'always'],
'dot-notation': 'warn',
'prefer-destructuring': ['error', { object: true, array: false }],
'quotes': ['error', 'single'],
'@stylistic/ts/indent': ['error', 2],
'@stylistic/ts/semi': ['error', 'always'],
'object-curly-spacing': ['error', 'always'],
'sort-imports': 'warn',
'callback-return': 'warn',
'global-require': 'warn',
'handle-callback-err': 'warn',
'no-buffer-constructor': 'error',
'no-mixed-requires': ['warn', { grouping: true, allowCall: true }],
'no-new-require': 'error',
'no-path-concat': 'error',
'no-process-exit': 'warn',
'@typescript-eslint/no-unused-vars': ['error'],
"tsdoc/syntax": "warn",
'jest/no-disabled-tests': 'warn',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/prefer-to-have-length': 'warn',
'jest/valid-expect': 'error',
},
},
];
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/no-anonymous-default-export */
/** @type {import('jest').Config} */
export default {
testEnvironment: 'jsdom',
Expand Down
Loading

0 comments on commit 22fc877

Please sign in to comment.