Skip to content

Commit

Permalink
feat: add typescript rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rskrz committed Apr 16, 2020
1 parent 974a4c3 commit 21e6914
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "C:\\Users\\ryans\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe"
}
9 changes: 9 additions & 0 deletions example/src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function doubleNumber(first: number): number {
return first * 2;
}

const abc = 123;

const def = doubleNumber(abc);

console.log(def);
2 changes: 2 additions & 0 deletions example/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
const foo: any = "";
console.log(foo);
const CamelCased = "abc";
console.log(CamelCased);
60 changes: 58 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ module.exports = {
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"semi": "off",
"no-process-env": "error",
"no-await-in-loop": "error",
"@typescript-eslint/indent": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
Expand All @@ -20,6 +26,56 @@ module.exports = {
}
],
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-empty-function": "off"
}
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "no-public",
"overrides": {
"parameterProperties": "off",
"properties": "explicit"
}
}
],
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "none",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/no-use-before-define": [
"error",
{
"functions": true,
"classes": false
}
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true,
"allowHigherOrderFunctions": false
}
],
"@typescript-eslint/ban-types": "off",
"camelcase": "off"
},
"overrides": [
{
"files": ["*.spec.ts"],
"rules": {
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-explicit-any": "warn"
}
}
]
};

0 comments on commit 21e6914

Please sign in to comment.