Skip to content

Commit 027d482

Browse files
committed
added tsconfig and tslint configurations
1 parent 1637b72 commit 027d482

File tree

2 files changed

+269
-0
lines changed

2 files changed

+269
-0
lines changed

tsconfig.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"compilerOptions": {
3+
/* Basic Options */
4+
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
5+
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
6+
"lib": [
7+
"ES2015",
8+
"es2016"
9+
] /* Specify library files to be included in the compilation. */,
10+
// "allowJs": true, /* Allow javascript files to be compiled. */
11+
// "checkJs": true, /* Report errors in .js files. */
12+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
13+
"declaration": true /* Generates corresponding '.d.ts' file. */,
14+
"sourceMap": true /* Generates corresponding '.map' file. */,
15+
// "outFile": "./", /* Concatenate and emit output to single file. */
16+
"outDir": "dist" /* Redirect output structure to the directory. */,
17+
"rootDir": "src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
18+
"removeComments": false /* Do not emit comments to output. */,
19+
// "noEmit": true, /* Do not emit outputs. */
20+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
21+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
22+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
23+
24+
/* Strict Type-Checking Options */
25+
"strict": true /* Enable all strict type-checking options. */,
26+
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
27+
// "strictNullChecks": true, /* Enable strict null checks. */
28+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
29+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
30+
"noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */,
31+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
32+
33+
/* Additional Checks */
34+
"noUnusedLocals": true /* Report errors on unused locals. */,
35+
"noUnusedParameters": true /* Report errors on unused parameters. */,
36+
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
37+
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
38+
39+
/* Module Resolution Options */
40+
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
41+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
42+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
43+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
44+
"typeRoots": [
45+
"./@types",
46+
"./node_modules/@types"
47+
] /* List of folders to include type definitions from. */,
48+
// "types": [], /* Type declaration files to be included in compilation. */
49+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
50+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
51+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
52+
53+
/* Source Map Options */
54+
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
55+
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
56+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
57+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
58+
59+
/* Experimental Options */
60+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
61+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
62+
},
63+
"includes": ["src/**/*"],
64+
"exclude": ["node_modules", "dist/**/*"],
65+
"compileOnSave": false
66+
}

tslint.json

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
{
2+
"rules": {
3+
"adjacent-overload-signatures": true,
4+
"ban-ts-ignore": true,
5+
"ban-types": [
6+
true,
7+
["Object", "Use {} instead."],
8+
["String", "Use string instead"]
9+
],
10+
"member-access": true,
11+
"member-ordering": [false],
12+
"no-any": true,
13+
"no-empty-interface": true,
14+
"no-import-side-effect": true,
15+
"no-inferrable-types": true,
16+
"no-internal-module": true,
17+
"no-magic-numbers": true,
18+
"no-namespace": [true, "allow-declarations"],
19+
"no-non-null-assertion": true,
20+
"no-reference": true,
21+
"no-unnecessary-type-assertion": true,
22+
"no-var-requires": true,
23+
"only-arrow-functions": [
24+
true,
25+
"allow-declarations",
26+
"allow-named-functions"
27+
],
28+
"prefer-for-of": true,
29+
"promise-function-async": true,
30+
"typedef": [false],
31+
"typedef-whitespace": [true],
32+
"unified-signatures": true,
33+
"await-promise": true,
34+
"ban-comma-operator": true,
35+
"ban": [true, "eval"],
36+
"curly": true,
37+
"forin": true,
38+
"function-constructor": true,
39+
"import-blacklist": true,
40+
"label-position": true,
41+
"no-arg": true,
42+
"no-bitwise": true,
43+
"no-conditional-assignment": true,
44+
"no-console": [true],
45+
"no-construct": true,
46+
"no-debugger": true,
47+
"no-duplicate-super": true,
48+
"no-duplicate-switch-case": true,
49+
"no-duplicate-variable": true,
50+
"no-dynamic-delete": true,
51+
"no-empty": true,
52+
"no-eval": true,
53+
"no-floating-promises": true,
54+
"no-for-in-array": true,
55+
"no-implicit-dependencies": [true, "dev"],
56+
"no-inferred-empty-object-type": true,
57+
"no-invalid-template-strings": true,
58+
"no-invalid-this": true,
59+
"no-misused-new": true,
60+
"no-null-keyword": false,
61+
"no-object-literal-type-assertion": true,
62+
"no-return-await": true,
63+
"no-shadowed-variable": true,
64+
"no-sparse-arrays": true,
65+
"no-string-literal": true,
66+
"no-string-throw": true,
67+
"no-submodule-imports": true,
68+
"no-switch-case-fall-through": true,
69+
"no-this-assignment": true,
70+
"no-unbound-method": true,
71+
"no-unnecessary-class": true,
72+
"no-unsafe-any": true,
73+
"no-unsafe-finally": true,
74+
"no-unused-expression": true,
75+
"no-unused-variable": true,
76+
"no-var-keyword": true,
77+
"no-void-expression": true,
78+
"prefer-conditional-expression": true,
79+
"prefer-object-spread": true,
80+
"radix": true,
81+
"restrict-plus-operands": true,
82+
"strict-boolean-expressions": true,
83+
"strict-type-predicates": true,
84+
"switch-default": true,
85+
"triple-equals": true,
86+
"typeof-compare": true,
87+
"use-default-type-parameter": true,
88+
"use-isnan": true,
89+
"cyclomatic-complexity": true,
90+
"eofline": true,
91+
"indent": [true, "spaces", 2],
92+
"linebreak-style": [true, "LF"],
93+
"max-classes-per-file": [true, 1],
94+
"max-file-line-count": [true, 100],
95+
"max-line-length": [true, 100],
96+
"no-default-export": true,
97+
"no-default-import": [true],
98+
"no-duplicate-imports": true,
99+
"no-mergeable-namespace": true,
100+
"no-require-imports": true,
101+
"object-literal-sort-keys": true,
102+
"prefer-const": true,
103+
"prefer-readonly": true,
104+
"trailing-comma": [
105+
true,
106+
{
107+
"objects": "always",
108+
"arrays": "always",
109+
"multiline": "always",
110+
"singleline": "never",
111+
"functions": "never",
112+
"typeLiterals": "ignore"
113+
}
114+
],
115+
"align": [false],
116+
"array-type": [true, "array"],
117+
"arrow-parens": [true, "ban-single-arg-parens"],
118+
"arrow-return-shorthand": [true, "multiline"],
119+
"binary-expression-operand-order": true,
120+
"callable-types": true,
121+
"class-name": true,
122+
"comment-format": [true, "check-space", "check-uppercase"],
123+
"comment-type": [true, "doc", "singleline", "multiline"],
124+
"completed-docs": [false],
125+
"encoding": true,
126+
"file-header": [false],
127+
"file-name-casing": [true, { ".tsx": "pascal-case", ".ts": "camel-case" }],
128+
"import-spacing": true,
129+
"increment-decrement": true,
130+
"interface-name": [true, "never-prefix"],
131+
"interface-over-type-literal": true,
132+
"jsdoc-format": true,
133+
"match-default-export-name": true,
134+
"newline-before-return": true,
135+
"newline-per-chained-call": true,
136+
"new-parens": true,
137+
"no-angle-bracket-type-assertion": true,
138+
"no-boolean-literal-compare": true,
139+
"no-consecutive-blank-lines": true,
140+
"no-irregular-whitespace": true,
141+
"no-parameter-properties": true,
142+
"no-redundant-jsdoc": true,
143+
"no-reference-import": true,
144+
"no-trailing-whitespace": true,
145+
"no-unnecessary-callback-wrapper": true,
146+
"no-unnecessary-initializer": true,
147+
"no-unnecessary-qualifier": true,
148+
"number-literal-format": true,
149+
"object-literal-key-quotes": [true, "as-needed"],
150+
"object-literal-shorthand": true,
151+
"one-line": [
152+
true,
153+
"check-catch",
154+
"check-finally",
155+
"check-else",
156+
"check-open-brace",
157+
"check-whitespace"
158+
],
159+
"one-variable-per-declaration": [
160+
true
161+
],
162+
"ordered-imports": [
163+
true
164+
],
165+
"prefer-function-over-method": true,
166+
"prefer-method-signature": false,
167+
"prefer-switch": [true, {"min-cases": 2}],
168+
"return-undefined": true,
169+
"prefer-template": true,
170+
"prefer-while": true,
171+
"quotemark": [
172+
true,
173+
"single",
174+
"jsx-double",
175+
"avoid-escape"
176+
],
177+
"semicolon": [
178+
true,
179+
"always"
180+
],
181+
"space-before-function-paren": false,
182+
"switch-final-break": true,
183+
"type-literal-delimiter": true,
184+
"unnecessary-bind": true,
185+
"variable-name": [
186+
true,
187+
"check-format",
188+
"ban-keywords",
189+
"allow-leading-underscore"
190+
],
191+
"whitespace": [
192+
true,
193+
"check-branch",
194+
"check-decl",
195+
"check-operator",
196+
"check-module",
197+
"check-separator",
198+
"check-type",
199+
"check-typecast",
200+
"check-preblock"
201+
]
202+
}
203+
}

0 commit comments

Comments
 (0)