Skip to content

Commit

Permalink
Migrate to eslint flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
vpmedia committed Feb 25, 2024
1 parent c398e4d commit a28aa82
Show file tree
Hide file tree
Showing 5 changed files with 485 additions and 61 deletions.
16 changes: 0 additions & 16 deletions .eslintignore

This file was deleted.

38 changes: 0 additions & 38 deletions .eslintrc.json

This file was deleted.

74 changes: 74 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import js from '@eslint/js';
import importPlugin from 'eslint-plugin-import';
import jsdocPlugin from 'eslint-plugin-jsdoc';
// import unicornPlugin from 'eslint-plugin-unicorn';
import globals from 'globals';

/** @type { import('eslint').Linter.FlatConfig[] } */
export default [
{
ignores: [
'.github/**/*.*',
'.idea/**/*.*',
'.vscode/**/*.*',
'build/**/*.*',
'coverage/**/*.*',
'dist/**/*.*',
'public/**/*.*',
'types/**/*.*',
'node_modules/**/*.*',
],
},
{
languageOptions: {
globals: {
...globals.jest,
...globals.browser,
...globals.node,
...globals.es2021,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
plugins: {
import: importPlugin,
jsdoc: jsdocPlugin,
// unicorn: unicornPlugin,
},
rules: {
...js.configs.recommended.rules,
'no-unused-vars': 'warn',
'prefer-arrow-callback': 'warn',
'prefer-template': 'warn',
'import/extensions': ['warn', 'always'],
'jsdoc/require-jsdoc': [
'warn',
{
require: {
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: false,
ArrowFunctionExpression: false,
FunctionExpression: false,
},
},
],
'jsdoc/check-indentation': 1,
'jsdoc/check-line-alignment': 1,
'jsdoc/check-syntax': 1,
'jsdoc/require-asterisk-prefix': 1,
'jsdoc/require-description': 1,
'jsdoc/require-description-complete-sentence': 1,
'jsdoc/require-hyphen-before-param-description': 1,
'jsdoc/require-throws': 1,
'jsdoc/sort-tags': 1,
'jsdoc/no-undefined-types': 0,
},
},
];

0 comments on commit a28aa82

Please sign in to comment.