mirror of https://github.com/grpc/grpc-node.git
refactor(grpc-js): convert from gts to eslint/prettier/tsconfig
GTS provides config for ESLint, Prettier and TSConfig; this commit removes GTS, but brings over the configuration details Fixes #2464
This commit is contained in:
parent
1880faf8a0
commit
e3522bb53b
|
@ -1,11 +1,61 @@
|
||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"extends": "./node_modules/gts",
|
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:node/recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:prettier/recommended"
|
||||||
|
],
|
||||||
|
"plugins": ["node", "prettier", "@typescript-eslint"],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 2018,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["**/generated/**", "**/node_modules/**", "**/build/**"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"node/no-unpublished-import": ["error", {
|
"node/no-unpublished-import": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
"tryExtensions": [".ts", ".js", ".json", ".node"]
|
"tryExtensions": [".ts", ".js", ".json", ".node"]
|
||||||
}],
|
}
|
||||||
|
],
|
||||||
"@typescript-eslint/no-unused-vars": "off",
|
"@typescript-eslint/no-unused-vars": "off",
|
||||||
"node/no-unpublished-require": "off"
|
"node/no-unpublished-require": "off",
|
||||||
|
"prettier/prettier": "error",
|
||||||
|
"block-scoped-var": "error",
|
||||||
|
"eqeqeq": "error",
|
||||||
|
"no-var": "error",
|
||||||
|
"prefer-const": "error",
|
||||||
|
"no-case-declarations": "warn",
|
||||||
|
"no-restricted-properties": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"object": "describe",
|
||||||
|
"property": "only"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"object": "it",
|
||||||
|
"property": "only"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
"@typescript-eslint/no-use-before-define": "off",
|
||||||
|
"@typescript-eslint/no-warning-comments": "off",
|
||||||
|
"@typescript-eslint/no-empty-function": "off",
|
||||||
|
"@typescript-eslint/no-var-requires": "off",
|
||||||
|
"@typescript-eslint/explicit-function-return-type": "off",
|
||||||
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||||
|
"@typescript-eslint/ban-types": "off",
|
||||||
|
"@typescript-eslint/camelcase": "off",
|
||||||
|
"node/no-missing-import": "off",
|
||||||
|
"node/no-empty-function": "off",
|
||||||
|
"node/no-unsupported-features/es-syntax": "off",
|
||||||
|
"node/no-missing-require": "off",
|
||||||
|
"node/shebang": "off",
|
||||||
|
"no-dupe-class-members": "off",
|
||||||
|
"require-atomic-updates": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,15 @@
|
||||||
"@types/ncp": "^2.0.1",
|
"@types/ncp": "^2.0.1",
|
||||||
"@types/pify": "^3.0.2",
|
"@types/pify": "^3.0.2",
|
||||||
"@types/semver": "^7.3.9",
|
"@types/semver": "^7.3.9",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
||||||
|
"@typescript-eslint/parser": "^5.59.11",
|
||||||
|
"@typescript-eslint/typescript-estree": "^5.59.11",
|
||||||
"clang-format": "^1.0.55",
|
"clang-format": "^1.0.55",
|
||||||
|
"eslint": "^8.42.0",
|
||||||
|
"eslint-config-prettier": "^8.8.0",
|
||||||
|
"eslint-plugin-node": "^11.1.0",
|
||||||
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"execa": "^2.0.3",
|
"execa": "^2.0.3",
|
||||||
"gts": "^3.1.1",
|
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-mocha": "^6.0.0",
|
"gulp-mocha": "^6.0.0",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
|
@ -32,10 +38,11 @@
|
||||||
"mocha-jenkins-reporter": "^0.4.1",
|
"mocha-jenkins-reporter": "^0.4.1",
|
||||||
"ncp": "^2.0.0",
|
"ncp": "^2.0.0",
|
||||||
"pify": "^4.0.1",
|
"pify": "^4.0.1",
|
||||||
|
"prettier": "^2.8.8",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^3.0.2",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.3.5",
|
||||||
"ts-node": "^8.3.0",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^4.8.4"
|
"typescript": "^5.1.3"
|
||||||
},
|
},
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
|
@ -47,11 +54,11 @@
|
||||||
"clean": "rimraf ./build",
|
"clean": "rimraf ./build",
|
||||||
"compile": "tsc -p .",
|
"compile": "tsc -p .",
|
||||||
"format": "clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts",
|
"format": "clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts",
|
||||||
"lint": "npm run check",
|
"lint": "eslint src/*.ts test/*.ts",
|
||||||
"prepare": "npm run generate-types && npm run compile",
|
"prepare": "npm run generate-types && npm run compile",
|
||||||
"test": "gulp test",
|
"test": "gulp test",
|
||||||
"check": "gts check src/**/*.ts",
|
"check": "npm run lint",
|
||||||
"fix": "gts fix src/*.ts",
|
"fix": "eslint --fix src/*.ts test/*.ts",
|
||||||
"pretest": "npm run generate-types && npm run generate-test-types && npm run compile",
|
"pretest": "npm run generate-types && npm run generate-test-types && npm run compile",
|
||||||
"posttest": "npm run check && madge -c ./build/src",
|
"posttest": "npm run check && madge -c ./build/src",
|
||||||
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto",
|
"generate-types": "proto-loader-gen-types --keepCase --longs String --enums String --defaults --oneofs --includeComments --includeDirs proto/ --include-dirs test/fixtures/ -O src/generated/ --grpcLib ../index channelz.proto",
|
||||||
|
|
|
@ -2,4 +2,6 @@ module.exports = {
|
||||||
proseWrap: 'always',
|
proseWrap: 'always',
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
trailingComma: 'es5',
|
trailingComma: 'es5',
|
||||||
|
bracketSpacing: true,
|
||||||
|
arrowParens: 'avoid',
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,15 @@
|
||||||
{
|
{
|
||||||
"extends": "./node_modules/gts/tsconfig-google.json",
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"allowUnreachableCode": false,
|
||||||
|
"allowUnusedLabels": false,
|
||||||
|
"declaration": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"noEmitOnError": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"pretty": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"strict": true,
|
||||||
"lib": ["es2017"],
|
"lib": ["es2017"],
|
||||||
"outDir": "build",
|
"outDir": "build",
|
||||||
"target": "es2017",
|
"target": "es2017",
|
||||||
|
@ -12,5 +21,8 @@
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
"test/**/*.ts"
|
"test/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue