Skip to content

Commit 44e88b9

Browse files
committed
new config
1 parent c073245 commit 44e88b9

File tree

4 files changed

+39
-21
lines changed

4 files changed

+39
-21
lines changed

eslint.config.mjs renamed to eslint.config.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import eslint from '@eslint/js';
2-
import tseslint from 'typescript-eslint';
3-
import jsdoc from 'eslint-plugin-jsdoc';
4-
import expectType from "eslint-plugin-expect-type/configs/recommended";
1+
const eslint = require('@eslint/js');
2+
const tseslint = require('typescript-eslint');
3+
const jsdoc = require('eslint-plugin-jsdoc');
54

6-
export default tseslint.config({
5+
module.exports = tseslint.config({
76
files: ['**/*.js', '**/*.ts'],
87
extends: [
9-
expectType,
108
eslint.configs.recommended,
119
...tseslint.configs.recommended,
12-
...tseslint.configs.recommendedTypeChecked,
1310
],
1411
plugins: {
1512
'@typescript-eslint': tseslint.plugin,
@@ -37,10 +34,6 @@ export default tseslint.config({
3734
"@typescript-eslint/no-var-requires": "off",
3835
"@typescript-eslint/no-non-null-assertion": "off",
3936
"@typescript-eslint/no-require-imports": "off",
40-
"@typescript-eslint/no-unsafe-call": "off",
41-
"@typescript-eslint/no-unsafe-member-access": "off",
42-
"@typescript-eslint/no-unsafe-argument": "off",
43-
"@typescript-eslint/no-unsafe-assignment": "off",
4437
"@typescript-eslint/no-unused-vars": [
4538
"error",
4639
{
@@ -79,10 +72,6 @@ export default tseslint.config({
7972
},
8073
languageOptions: {
8174
parser: tseslint.parser,
82-
parserOptions: {
83-
projectService: true,
84-
tsconfigRootDir: import.meta.dirname,
85-
},
8675
globals: {
8776
__dirname: true,
8877
beforeEach: true,

eslint.config.test.mjs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import expectType from 'eslint-plugin-expect-type/configs/recommended';
4+
5+
export default tseslint.config({
6+
files: ['**/*.js', '**/*.ts'],
7+
extends: [
8+
expectType,
9+
eslint.configs.recommended,
10+
...tseslint.configs.recommended,
11+
...tseslint.configs.recommendedTypeChecked,
12+
],
13+
plugins: {
14+
'@typescript-eslint': tseslint.plugin,
15+
},
16+
rules: {
17+
'no-empty': 'off',
18+
'@typescript-eslint/no-unused-vars': 'off',
19+
'@typescript-eslint/no-unused-expressions': 'off',
20+
'@typescript-eslint/no-empty-object-type': 'off',
21+
'@typescript-eslint/ban-ts-comment': 'off',
22+
'@typescript-eslint/no-unsafe-call': 'off',
23+
'@typescript-eslint/no-unsafe-member-access': 'off',
24+
'@typescript-eslint/no-unsafe-argument': 'off',
25+
'@typescript-eslint/no-unsafe-assignment': 'off',
26+
},
27+
languageOptions: {
28+
parser: tseslint.parser,
29+
parserOptions: {
30+
projectService: true,
31+
tsconfigRootDir: import.meta.dirname,
32+
},
33+
},
34+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"posttest:mongodb": "mongodb-runner stop --all",
106106
"lint": "eslint --cache src/ integration/",
107107
"lint:fix": "eslint --fix --cache src/ integration/",
108-
"test:types": "eslint --cache types/tests.ts",
108+
"test:types": "eslint --cache types/tests.ts -c eslint.config.test.mjs",
109109
"watch": "cross-env PARSE_BUILD=${PARSE_BUILD} gulp watch",
110110
"watch:browser": "cross-env PARSE_BUILD=browser npm run watch",
111111
"watch:node": "cross-env PARSE_BUILD=node npm run watch",

types/tests.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-unused-expressions, @typescript-eslint/no-empty-object-type, no-empty */
2-
3-
// Run the following command to get number of failed tests
4-
// $ npm run test:types 2>&1 | tee temp.txt; grep 'ERROR:' temp.txt -c; rm temp.txt;
5-
61
import Parse from 'parse';
72
import ParseNode from 'parse/node';
83
import ParseRN from 'parse/react-native';

0 commit comments

Comments
 (0)