Skip to content

Commit

Permalink
Update tslint config and add prettier.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongrout committed Jan 3, 2020
1 parent af90227 commit 7de02f5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 65 deletions.
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
15 changes: 14 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@
"clean": "lerna run clean",
"integrity": "node scripts/package-integrity.js",
"lint": "lerna run lint",
"integrity2": "node buildutils/lib/integrity.js",
"lint2": "yarn && yarn run prettier && yarn run tslint",
"lint:check": "yarn run prettier:check && yarn run tslint:check",
"prettier": "prettier --ignore-path .gitignore --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}'",
"prettier:check": "prettier --ignore-path .gitignore --check '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}'",
"sort-package-json": "lerna exec --parallel sort-package-json && sort-package-json",
"tslint": "tslint --fix -c tslint.json --project tsconfigbase.json '**/*{.ts,.tsx}'",
"tslint:check": "tslint -c tslint.json --project tsconfigbase.json '**/*{.ts,.tsx}'",
"publish": "yarn run clean && yarn run build && lerna publish -m \"Publish npm packages\"",
"update-dependency": "update-dependency --lerna",
"updated": "lerna updated"
},
"devDependencies": {
"@jupyterlab/buildutils": "^2.0.0-beta.1",
"lerna": "^3.2.1"
"lerna": "^3.20.2",
"prettier": "^1.19.1",
"sort-package-json": "~1.35",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.1.0"
}
}
96 changes: 32 additions & 64 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -1,78 +1,53 @@
{
"rulesDirectory": ["tslint-plugin-prettier"],
"rules": {
"align": [
true,
"parameters",
"statements"
],
"prettier": [true, { "singleQuote": true }],
"align": [true, "parameters", "statements"],
"await-promise": true,
"ban": [
true,
[ "_", "forEach" ],
[ "_", "each" ],
[ "$", "each" ],
[ "angular", "forEach" ]
["_", "forEach"],
["_", "each"],
["$", "each"],
["angular", "forEach"]
],
"class-name": true,
"comment-format": [
true,
"check-space"
],
"comment-format": [true, "check-space"],
"curly": true,
"eofline": true,
"forin": false,
"indent": [
true,
"spaces"
],
"interface-name": [
true,
"always-prefix"
],
"indent": [true, "spaces", 2],
"interface-name": [true, "always-prefix"],
"jsdoc-format": true,
"label-position": true,
"max-line-length": [
false
],
"max-line-length": [false],
"member-access": false,
"member-ordering": [
false
],
"member-ordering": [false],
"new-parens": true,
"no-angle-bracket-type-assertion": true,
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": false,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
"no-construct": true,
"no-debugger": true,
"no-default-export": false,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-floating-promises": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-invalid-this": [
true,
"check-function-in-method"
],
"no-invalid-this": [true, "check-function-in-method"],
"no-null-keyword": false,
"no-reference": true,
"no-require-imports": false,
"no-shadowed-variable": false,
"no-string-literal": false,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
// "no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": false,
"no-var-keyword": true,
"no-var-requires": true,
Expand All @@ -85,16 +60,13 @@
"check-finally",
"check-whitespace"
],
"one-variable-per-declaration": [true,
"ignore-for-loop"
],
"quotemark": [
true,
"single",
"avoid-escape"
],
"one-variable-per-declaration": [true, "ignore-for-loop"],
"quotemark": {
"options": ["single", "avoid-escape"],
"severity": "off"
},
"radix": true,
"semicolon": [true, "always"],
"semicolon": [true, "always", "ignore-bound-class-methods"],
"switch-default": true,
"trailing-comma": [
false,
Expand All @@ -103,14 +75,8 @@
"singleline": "never"
}
],
"triple-equals": [
true,
"allow-null-check",
"allow-undefined-check"
],
"typedef": [
false
],
"triple-equals": [true, "allow-null-check", "allow-undefined-check"],
"typedef": [false],
"typedef-whitespace": [
false,
{
Expand All @@ -129,14 +95,13 @@
}
],
"use-isnan": true,
"use-strict": [
false
],
"use-strict": [false],
"variable-name": [
true,
// "check-format",
"check-format",
"allow-leading-underscore",
"ban-keywords"
"ban-keywords",
"allow-pascal-case"
],
"whitespace": [
true,
Expand All @@ -145,5 +110,8 @@
"check-separator",
"check-type"
]
},
"linterOptions": {
"exclude": ["node_modules/**/*.ts", "node_modules/**/*.tsx", "**/*.d.ts"]
}
}
}

0 comments on commit 7de02f5

Please sign in to comment.