Skip to content

Commit 5e2692d

Browse files
authored
Define type declarations for json formatting (#128)
* define type declarations for json formatting * update JsonGetFormatter interface * 2.14.9
1 parent b4126d2 commit 5e2692d

File tree

7 files changed

+764
-240
lines changed

7 files changed

+764
-240
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 34 deletions
This file was deleted.

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ spec
1010
# eslint
1111
.eslintrc
1212
.eslintignore
13+
eslint.config.mjs
1314

1415
# dotenv
1516
.env

eslint.config.mjs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import globals from 'globals';
2+
import babelParser from '@babel/eslint-parser';
3+
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
4+
import tsParser from '@typescript-eslint/parser';
5+
import path from 'node:path';
6+
import { fileURLToPath } from 'node:url';
7+
import js from '@eslint/js';
8+
import { FlatCompat } from '@eslint/eslintrc';
9+
import jest from 'eslint-plugin-jest';
10+
11+
const __filename = fileURLToPath(import.meta.url);
12+
const __dirname = path.dirname(__filename);
13+
const compat = new FlatCompat({
14+
baseDirectory: __dirname,
15+
recommendedConfig: js.configs.recommended,
16+
allConfig: js.configs.all
17+
});
18+
19+
export default [{
20+
ignores: ['**/dist', '**/node_modules'],
21+
}, {
22+
files: ['spec/**'],
23+
...jest.configs['flat/recommended'],
24+
rules: {
25+
...jest.configs['flat/recommended'].rules,
26+
'jest/prefer-expect-assertions': 'off',
27+
},
28+
}, ...compat.extends('eslint:recommended'), {
29+
languageOptions: {
30+
globals: {
31+
...globals.node
32+
},
33+
parser: babelParser,
34+
},
35+
rules: {
36+
'no-console': 'off',
37+
'no-invalid-this': 'warn',
38+
'no-undef': 'error',
39+
'no-unused-vars': 'warn',
40+
'no-var': ['error'],
41+
quotes: ['error', 'single'],
42+
strict: [2, 'never'],
43+
},
44+
}, ...compat.extends(
45+
'eslint:recommended',
46+
'plugin:@typescript-eslint/eslint-recommended',
47+
'plugin:@typescript-eslint/recommended',
48+
).map(config => ({
49+
...config,
50+
files: ['src/**/*.d.ts'],
51+
})), {
52+
files: ['src/**/*.d.ts'],
53+
plugins: {
54+
'@typescript-eslint': typescriptPlugin,
55+
},
56+
rules: {
57+
'@typescript-eslint/no-explicit-any': 'off',
58+
},
59+
languageOptions: {
60+
parser: tsParser,
61+
},
62+
}];

0 commit comments

Comments
 (0)