Skip to content

Commit 943f62c

Browse files
committed
ESLint work in progress
1 parent 2ad200e commit 943f62c

7 files changed

+1158
-33
lines changed

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/coverage/
2+
/test-build/
3+
4+
node_modules/
5+
dist/
6+
dist-cjs/

.eslintrc.cjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// eslint-disable-next-line node/no-process-env
2+
const isQuick = process.env.LINT_QUICK !== "false";
3+
4+
const tsProject = ["./packages/*/tsconfig-cjs.json", "./tsconfig-test.json"];
5+
6+
module.exports = {
7+
root: true,
8+
extends: [
9+
"@gcangussu/eslint-config",
10+
"@gcangussu/eslint-config/node",
11+
...(isQuick ? ["@gcangussu/eslint-config/quick"] : []),
12+
],
13+
parserOptions: {
14+
tsconfigRootDir: __dirname,
15+
project: tsProject,
16+
},
17+
settings: {
18+
"import/resolver": {
19+
typescript: {
20+
project: tsProject,
21+
},
22+
},
23+
},
24+
};

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// For a detailed explanation regarding each configuration property, visit:
22
// https://jestjs.io/docs/en/configuration.html
33

4+
// eslint-disable-next-line import/no-anonymous-default-export
45
export default {
56
// All imported modules in your tests should be mocked automatically
67
// automock: false,

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
],
1717
"scripts": {
1818
"build": "tsc --build",
19+
"build-pkgs": "tsc --build tsconfig-pkgs.json",
1920
"build-tests": "tsc --build tsconfig-test.json",
21+
"lint": "LINT_QUICK=false eslint --max-warnings 0 --report-unused-disable-directives --format codeframe .",
2022
"test": "jest"
2123
},
2224
"husky": {
@@ -31,9 +33,12 @@
3133
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
3234
"@babel/plugin-transform-modules-commonjs": "^7.10.4",
3335
"@babel/preset-typescript": "^7.10.4",
36+
"@gcangussu/eslint-config": "^6.1.4",
3437
"@gcangussu/proto-parser": "0.1.1",
3538
"@types/jest": "^26.0.10",
3639
"@types/node": "^14.6.2",
40+
"eslint": "^7.7.0",
41+
"eslint-import-resolver-typescript": "^2.2.1",
3742
"husky": "^4.2.5",
3843
"jest": "^26.4.2",
3944
"prettier": "^2.1.1",

tsconfig-pkgs.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"files": [],
3+
"include": [],
4+
"references": [
5+
{ "path": "packages/proto-parser/tsconfig.json" },
6+
{ "path": "packages/proto-parser/tsconfig-cjs.json" },
7+
{ "path": "packages/grpc-frame/tsconfig.json" },
8+
{ "path": "packages/grpc-frame/tsconfig-cjs.json" }
9+
]
10+
}

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"files": [],
33
"include": [],
44
"references": [
5-
{ "path": "packages/proto-parser/tsconfig.json" },
6-
{ "path": "packages/proto-parser/tsconfig-cjs.json" },
7-
{ "path": "packages/grpc-frame/tsconfig.json" },
8-
{ "path": "packages/grpc-frame/tsconfig-cjs.json" }
5+
{ "path": "./tsconfig-pkgs.json" },
6+
{ "path": "./tsconfig-test.json" }
97
]
108
}

0 commit comments

Comments
 (0)