|
|
@@ -1,68 +1,40 @@
|
|
|
import globals from 'globals';
|
|
|
import eslintJs from '@eslint/js';
|
|
|
-import eslintTypescript from 'typescript-eslint';
|
|
|
import eslintJsdocPlugin from 'eslint-plugin-jsdoc';
|
|
|
import eslintMochaPlugin from 'eslint-plugin-mocha';
|
|
|
+import eslintImportPlugin from 'eslint-plugin-import';
|
|
|
import eslintPrettierConfig from 'eslint-config-prettier';
|
|
|
import eslintChaiExpectPlugin from 'eslint-plugin-chai-expect';
|
|
|
|
|
|
-export default [
|
|
|
- {
|
|
|
- files: ['src/**/*.js'],
|
|
|
- languageOptions: {
|
|
|
- globals: {
|
|
|
- ...globals.node,
|
|
|
- ...globals.es2021,
|
|
|
- ...globals.mocha,
|
|
|
- },
|
|
|
- },
|
|
|
- plugins: {
|
|
|
- 'jsdoc': eslintJsdocPlugin,
|
|
|
- 'mocha': eslintMochaPlugin,
|
|
|
- 'chai-expect': eslintChaiExpectPlugin,
|
|
|
- },
|
|
|
- rules: {
|
|
|
- ...eslintJs.configs.recommended.rules,
|
|
|
- ...eslintPrettierConfig.rules,
|
|
|
- ...eslintMochaPlugin.configs.recommended.rules,
|
|
|
- ...eslintChaiExpectPlugin.configs['recommended-flat'].rules,
|
|
|
- ...eslintJsdocPlugin.configs['flat/recommended-error'].rules,
|
|
|
- 'no-unused-vars': ['error', {'caughtErrors': 'none'}],
|
|
|
- 'jsdoc/reject-any-type': 0,
|
|
|
- 'jsdoc/reject-function-type': 0,
|
|
|
- 'jsdoc/require-param-description': 0,
|
|
|
- 'jsdoc/require-returns-description': 0,
|
|
|
- 'jsdoc/require-property-description': 0,
|
|
|
- 'jsdoc/tag-lines': ['error', 'any', {startLines: 1}],
|
|
|
+export default [{
|
|
|
+ files: ['src/**/*.js'],
|
|
|
+ languageOptions: {
|
|
|
+ globals: {
|
|
|
+ ...globals.node,
|
|
|
+ ...globals.es2021,
|
|
|
+ ...globals.mocha,
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- files: ['src/**/*.ts'],
|
|
|
- ignores: ['src/**/*.d.ts'],
|
|
|
- languageOptions: {
|
|
|
- globals: {
|
|
|
- ...globals.node,
|
|
|
- ...globals.es2021,
|
|
|
- ...globals.mocha,
|
|
|
- },
|
|
|
- parser: eslintTypescript.parser,
|
|
|
- parserOptions: {
|
|
|
- projectService: true,
|
|
|
- tsconfigRootDir: import.meta.dirname,
|
|
|
- },
|
|
|
- },
|
|
|
- plugins: {
|
|
|
- '@typescript-eslint': eslintTypescript.plugin,
|
|
|
- 'mocha': eslintMochaPlugin,
|
|
|
- 'chai-expect': eslintChaiExpectPlugin,
|
|
|
- },
|
|
|
- rules: {
|
|
|
- ...eslintJs.configs.recommended.rules,
|
|
|
- ...eslintPrettierConfig.rules,
|
|
|
- ...eslintTypescript.configs.recommended.rules,
|
|
|
- '@typescript-eslint/no-namespace': 0,
|
|
|
- '@typescript-eslint/no-var-requires': 0,
|
|
|
- '@typescript-eslint/no-unnecessary-type-constraint': 0,
|
|
|
- },
|
|
|
+ plugins: {
|
|
|
+ 'jsdoc': eslintJsdocPlugin,
|
|
|
+ 'mocha': eslintMochaPlugin,
|
|
|
+ 'import': eslintImportPlugin,
|
|
|
+ 'chai-expect': eslintChaiExpectPlugin,
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ ...eslintJs.configs.recommended.rules,
|
|
|
+ ...eslintPrettierConfig.rules,
|
|
|
+ ...eslintImportPlugin.flatConfigs.recommended.rules,
|
|
|
+ ...eslintMochaPlugin.configs.recommended.rules,
|
|
|
+ ...eslintChaiExpectPlugin.configs['recommended-flat'].rules,
|
|
|
+ ...eslintJsdocPlugin.configs['flat/recommended-error'].rules,
|
|
|
+ 'no-duplicate-imports': 'error',
|
|
|
+ 'import/export': 0,
|
|
|
+ 'jsdoc/reject-any-type': 0,
|
|
|
+ 'jsdoc/reject-function-type': 0,
|
|
|
+ 'jsdoc/require-param-description': 0,
|
|
|
+ 'jsdoc/require-returns-description': 0,
|
|
|
+ 'jsdoc/require-property-description': 0,
|
|
|
+ 'jsdoc/tag-lines': ['error', 'any', {startLines: 1}],
|
|
|
},
|
|
|
-];
|
|
|
+}];
|