flit-modulo-exportacoes 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +87 -0
- package/dist/index.js +45 -0
- package/lib/index.ts +91 -0
- package/package.json +26 -0
- package/tsconfig.json +63 -0
- package/tslint.json +118 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface com a declaração dos campos do objeto "eventos" da coleção "eventos_exportacoes".
|
|
3
|
+
*
|
|
4
|
+
* @interface TipoEventoExportacao
|
|
5
|
+
*/
|
|
6
|
+
export declare enum TipoEventoExportacao {
|
|
7
|
+
FALTA = "falta",
|
|
8
|
+
ATRASO = "atraso",
|
|
9
|
+
HORA_NOTURNA = "hora_noturna",
|
|
10
|
+
HORA_EXTRA_SEG_SEX = "hora_extra",
|
|
11
|
+
HORA_EXTRA_SAB = "hora_extra_sabado",
|
|
12
|
+
HORA_EXTRA_DOM = "hora_extra_domingo",
|
|
13
|
+
HORA_EXTRA_FER = "hora_extra_feriado",
|
|
14
|
+
HORAS_NOTURNAS_TOTAIS = "horas_noturnas_totais",
|
|
15
|
+
HORA_EXTRA_NOTURNA_SEG_SEX = "hora_extra_noturna",
|
|
16
|
+
HORA_EXTRA_INTRAJORNADA = "hora_extra_intrajornada",
|
|
17
|
+
HORA_EXTRA_NOTURNA_SAB = "hora_extra_noturna_sabado",
|
|
18
|
+
HORA_EXTRA_NOTURNA_DOM = "hora_extra_noturna_domingo",
|
|
19
|
+
HORA_EXTRA_NOTURNA_FER = "hora_extra_noturna_feriado"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Interface com a declaração dos tipos de eventos de exportação que o usuário seleciona no manager.
|
|
23
|
+
*
|
|
24
|
+
* @interface TiposEventosExportar
|
|
25
|
+
*/
|
|
26
|
+
export declare enum TiposEventosExportar {
|
|
27
|
+
FALTA = "FALTA",
|
|
28
|
+
ATRASO = "ATRASO",
|
|
29
|
+
HORA_NOTURNA = "HORA_NOTURNA",
|
|
30
|
+
HORA_EXTRA_SAB = "HORA_EXTRA_SAB",
|
|
31
|
+
HORA_EXTRA_DOM = "HORA_EXTRA_DOM",
|
|
32
|
+
HORA_EXTRA_FER = "HORA_EXTRA_FER",
|
|
33
|
+
HORA_EXTRA_SEG_SEX = "HORA_EXTRA_SEG_SEX",
|
|
34
|
+
HORAS_NOTURNAS_TOTAIS = "HORAS_NOTURNAS_TOTAIS",
|
|
35
|
+
HORA_EXTRA_NOTURNA_DOM = "HORA_EXTRA_NOTURNA_DOM",
|
|
36
|
+
HORA_EXTRA_NOTURNA_FER = "HORA_EXTRA_NOTURNA_FER",
|
|
37
|
+
HORA_EXTRA_NOTURNA_SAB = "HORA_EXTRA_NOTURNA_SAB",
|
|
38
|
+
HORA_EXTRA_INTRAJORNADA = "HORA_EXTRA_INTRAJORNADA",
|
|
39
|
+
HORA_EXTRA_NOTURNA_SEG_SEX = "HORA_EXTRA_NOTURNA_SEG_SEX"
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Interface do modelo do payload das funções de exportação.
|
|
43
|
+
*
|
|
44
|
+
* @interface PayloadExportacaoPadrao
|
|
45
|
+
*/
|
|
46
|
+
export interface PayloadExportacaoPadrao {
|
|
47
|
+
conta_id: string;
|
|
48
|
+
timezone?: string;
|
|
49
|
+
data_final: string;
|
|
50
|
+
empresa_id?: string;
|
|
51
|
+
usuario_id?: string;
|
|
52
|
+
data_inicial: string;
|
|
53
|
+
tabela_eventos_id: string;
|
|
54
|
+
tipos_eventos: Array<TiposEventosExportar>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Interface do modelo do payload das funções de exportação.
|
|
58
|
+
*
|
|
59
|
+
* @interface DadosEmpresaExportacao
|
|
60
|
+
*/
|
|
61
|
+
export interface DadosEmpresaExportacao {
|
|
62
|
+
id: string;
|
|
63
|
+
endereco: {
|
|
64
|
+
uf: string;
|
|
65
|
+
cidade: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Interface com o modelo dos valores calculados para montar o arquivo que será exportado.
|
|
70
|
+
*
|
|
71
|
+
* @interface ValoresEventosExportacao
|
|
72
|
+
*/
|
|
73
|
+
export interface ValoresEventosExportacao {
|
|
74
|
+
ValorFaltas: number;
|
|
75
|
+
MinutosAtraso: number;
|
|
76
|
+
MinutosNoturnos: number;
|
|
77
|
+
MinutosExtrasSegSex: number;
|
|
78
|
+
MinutosExtrasSabado: number;
|
|
79
|
+
MinutosExtrasDomingo: number;
|
|
80
|
+
MinutosExtrasFeriado: number;
|
|
81
|
+
MinutosNoturnosTotais: number;
|
|
82
|
+
MinutosExtrasIntrajornada: number;
|
|
83
|
+
MinutosExtrasNoturnosSegSex: number;
|
|
84
|
+
MinutosExtrasNoturnosSabado: number;
|
|
85
|
+
MinutosExtrasNoturnosDomingo: number;
|
|
86
|
+
MinutosExtrasNoturnosFeriado: number;
|
|
87
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TiposEventosExportar = exports.TipoEventoExportacao = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Interface com a declaração dos campos do objeto "eventos" da coleção "eventos_exportacoes".
|
|
6
|
+
*
|
|
7
|
+
* @interface TipoEventoExportacao
|
|
8
|
+
*/
|
|
9
|
+
var TipoEventoExportacao;
|
|
10
|
+
(function (TipoEventoExportacao) {
|
|
11
|
+
TipoEventoExportacao["FALTA"] = "falta";
|
|
12
|
+
TipoEventoExportacao["ATRASO"] = "atraso";
|
|
13
|
+
TipoEventoExportacao["HORA_NOTURNA"] = "hora_noturna";
|
|
14
|
+
TipoEventoExportacao["HORA_EXTRA_SEG_SEX"] = "hora_extra";
|
|
15
|
+
TipoEventoExportacao["HORA_EXTRA_SAB"] = "hora_extra_sabado";
|
|
16
|
+
TipoEventoExportacao["HORA_EXTRA_DOM"] = "hora_extra_domingo";
|
|
17
|
+
TipoEventoExportacao["HORA_EXTRA_FER"] = "hora_extra_feriado";
|
|
18
|
+
TipoEventoExportacao["HORAS_NOTURNAS_TOTAIS"] = "horas_noturnas_totais";
|
|
19
|
+
TipoEventoExportacao["HORA_EXTRA_NOTURNA_SEG_SEX"] = "hora_extra_noturna";
|
|
20
|
+
TipoEventoExportacao["HORA_EXTRA_INTRAJORNADA"] = "hora_extra_intrajornada";
|
|
21
|
+
TipoEventoExportacao["HORA_EXTRA_NOTURNA_SAB"] = "hora_extra_noturna_sabado";
|
|
22
|
+
TipoEventoExportacao["HORA_EXTRA_NOTURNA_DOM"] = "hora_extra_noturna_domingo";
|
|
23
|
+
TipoEventoExportacao["HORA_EXTRA_NOTURNA_FER"] = "hora_extra_noturna_feriado";
|
|
24
|
+
})(TipoEventoExportacao = exports.TipoEventoExportacao || (exports.TipoEventoExportacao = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Interface com a declaração dos tipos de eventos de exportação que o usuário seleciona no manager.
|
|
27
|
+
*
|
|
28
|
+
* @interface TiposEventosExportar
|
|
29
|
+
*/
|
|
30
|
+
var TiposEventosExportar;
|
|
31
|
+
(function (TiposEventosExportar) {
|
|
32
|
+
TiposEventosExportar["FALTA"] = "FALTA";
|
|
33
|
+
TiposEventosExportar["ATRASO"] = "ATRASO";
|
|
34
|
+
TiposEventosExportar["HORA_NOTURNA"] = "HORA_NOTURNA";
|
|
35
|
+
TiposEventosExportar["HORA_EXTRA_SAB"] = "HORA_EXTRA_SAB";
|
|
36
|
+
TiposEventosExportar["HORA_EXTRA_DOM"] = "HORA_EXTRA_DOM";
|
|
37
|
+
TiposEventosExportar["HORA_EXTRA_FER"] = "HORA_EXTRA_FER";
|
|
38
|
+
TiposEventosExportar["HORA_EXTRA_SEG_SEX"] = "HORA_EXTRA_SEG_SEX";
|
|
39
|
+
TiposEventosExportar["HORAS_NOTURNAS_TOTAIS"] = "HORAS_NOTURNAS_TOTAIS";
|
|
40
|
+
TiposEventosExportar["HORA_EXTRA_NOTURNA_DOM"] = "HORA_EXTRA_NOTURNA_DOM";
|
|
41
|
+
TiposEventosExportar["HORA_EXTRA_NOTURNA_FER"] = "HORA_EXTRA_NOTURNA_FER";
|
|
42
|
+
TiposEventosExportar["HORA_EXTRA_NOTURNA_SAB"] = "HORA_EXTRA_NOTURNA_SAB";
|
|
43
|
+
TiposEventosExportar["HORA_EXTRA_INTRAJORNADA"] = "HORA_EXTRA_INTRAJORNADA";
|
|
44
|
+
TiposEventosExportar["HORA_EXTRA_NOTURNA_SEG_SEX"] = "HORA_EXTRA_NOTURNA_SEG_SEX";
|
|
45
|
+
})(TiposEventosExportar = exports.TiposEventosExportar || (exports.TiposEventosExportar = {}));
|
package/lib/index.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface com a declaração dos campos do objeto "eventos" da coleção "eventos_exportacoes".
|
|
3
|
+
*
|
|
4
|
+
* @interface TipoEventoExportacao
|
|
5
|
+
*/
|
|
6
|
+
export enum TipoEventoExportacao {
|
|
7
|
+
FALTA = 'falta',
|
|
8
|
+
ATRASO = 'atraso',
|
|
9
|
+
HORA_NOTURNA = 'hora_noturna',
|
|
10
|
+
HORA_EXTRA_SEG_SEX = 'hora_extra',
|
|
11
|
+
HORA_EXTRA_SAB = 'hora_extra_sabado',
|
|
12
|
+
HORA_EXTRA_DOM = 'hora_extra_domingo',
|
|
13
|
+
HORA_EXTRA_FER = 'hora_extra_feriado',
|
|
14
|
+
HORAS_NOTURNAS_TOTAIS = 'horas_noturnas_totais',
|
|
15
|
+
HORA_EXTRA_NOTURNA_SEG_SEX = 'hora_extra_noturna',
|
|
16
|
+
HORA_EXTRA_INTRAJORNADA = 'hora_extra_intrajornada',
|
|
17
|
+
HORA_EXTRA_NOTURNA_SAB = 'hora_extra_noturna_sabado',
|
|
18
|
+
HORA_EXTRA_NOTURNA_DOM = 'hora_extra_noturna_domingo',
|
|
19
|
+
HORA_EXTRA_NOTURNA_FER = 'hora_extra_noturna_feriado'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Interface com a declaração dos tipos de eventos de exportação que o usuário seleciona no manager.
|
|
24
|
+
*
|
|
25
|
+
* @interface TiposEventosExportar
|
|
26
|
+
*/
|
|
27
|
+
export enum TiposEventosExportar {
|
|
28
|
+
FALTA = 'FALTA',
|
|
29
|
+
ATRASO = 'ATRASO',
|
|
30
|
+
HORA_NOTURNA = 'HORA_NOTURNA',
|
|
31
|
+
HORA_EXTRA_SAB = 'HORA_EXTRA_SAB',
|
|
32
|
+
HORA_EXTRA_DOM = 'HORA_EXTRA_DOM',
|
|
33
|
+
HORA_EXTRA_FER = 'HORA_EXTRA_FER',
|
|
34
|
+
HORA_EXTRA_SEG_SEX = 'HORA_EXTRA_SEG_SEX',
|
|
35
|
+
HORAS_NOTURNAS_TOTAIS = 'HORAS_NOTURNAS_TOTAIS',
|
|
36
|
+
HORA_EXTRA_NOTURNA_DOM = 'HORA_EXTRA_NOTURNA_DOM',
|
|
37
|
+
HORA_EXTRA_NOTURNA_FER = 'HORA_EXTRA_NOTURNA_FER',
|
|
38
|
+
HORA_EXTRA_NOTURNA_SAB = 'HORA_EXTRA_NOTURNA_SAB',
|
|
39
|
+
HORA_EXTRA_INTRAJORNADA = 'HORA_EXTRA_INTRAJORNADA',
|
|
40
|
+
HORA_EXTRA_NOTURNA_SEG_SEX = 'HORA_EXTRA_NOTURNA_SEG_SEX'
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Interface do modelo do payload das funções de exportação.
|
|
45
|
+
*
|
|
46
|
+
* @interface PayloadExportacaoPadrao
|
|
47
|
+
*/
|
|
48
|
+
export interface PayloadExportacaoPadrao {
|
|
49
|
+
conta_id: string;
|
|
50
|
+
timezone?: string;
|
|
51
|
+
data_final: string;
|
|
52
|
+
empresa_id?: string;
|
|
53
|
+
usuario_id?: string;
|
|
54
|
+
data_inicial: string;
|
|
55
|
+
tabela_eventos_id: string;
|
|
56
|
+
tipos_eventos: Array<TiposEventosExportar>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Interface do modelo do payload das funções de exportação.
|
|
61
|
+
*
|
|
62
|
+
* @interface DadosEmpresaExportacao
|
|
63
|
+
*/
|
|
64
|
+
export interface DadosEmpresaExportacao {
|
|
65
|
+
id: string;
|
|
66
|
+
endereco: {
|
|
67
|
+
uf: string;
|
|
68
|
+
cidade: string;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Interface com o modelo dos valores calculados para montar o arquivo que será exportado.
|
|
74
|
+
*
|
|
75
|
+
* @interface ValoresEventosExportacao
|
|
76
|
+
*/
|
|
77
|
+
export interface ValoresEventosExportacao {
|
|
78
|
+
ValorFaltas: number;
|
|
79
|
+
MinutosAtraso: number;
|
|
80
|
+
MinutosNoturnos: number;
|
|
81
|
+
MinutosExtrasSegSex: number;
|
|
82
|
+
MinutosExtrasSabado: number;
|
|
83
|
+
MinutosExtrasDomingo: number;
|
|
84
|
+
MinutosExtrasFeriado: number;
|
|
85
|
+
MinutosNoturnosTotais: number;
|
|
86
|
+
MinutosExtrasIntrajornada: number;
|
|
87
|
+
MinutosExtrasNoturnosSegSex: number;
|
|
88
|
+
MinutosExtrasNoturnosSabado: number;
|
|
89
|
+
MinutosExtrasNoturnosDomingo: number;
|
|
90
|
+
MinutosExtrasNoturnosFeriado: number;
|
|
91
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "flit-modulo-exportacoes",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/lib/index.js",
|
|
6
|
+
"directories": {
|
|
7
|
+
"lib": "lib"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "DirectOn Tecnologia",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"types": "dist/lib/index.d.ts",
|
|
13
|
+
"prepublish": "npm run build",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"tsc-alias": "^1.7.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^4.8.4"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json",
|
|
22
|
+
"prepare": "npm run build",
|
|
23
|
+
"version": "npm run format && git add -A lib",
|
|
24
|
+
"postversion": "git push && git push --tags"
|
|
25
|
+
}
|
|
26
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Basic Options */
|
|
4
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
5
|
+
"target": "ES2022" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
|
|
6
|
+
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
|
7
|
+
// "lib": [], /* Specify library files to be included in the compilation. */
|
|
8
|
+
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
9
|
+
// "checkJs": true, /* Report errors in .js files. */
|
|
10
|
+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
11
|
+
"declaration": true /* Generates corresponding '.d.ts' file. */,
|
|
12
|
+
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
13
|
+
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
|
14
|
+
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
15
|
+
"outDir": "dist" /* Redirect output structure to the directory. */,
|
|
16
|
+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
17
|
+
// "composite": true, /* Enable project compilation */
|
|
18
|
+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
19
|
+
// "removeComments": true, /* Do not emit comments to output. */
|
|
20
|
+
// "noEmit": true, /* Do not emit outputs. */
|
|
21
|
+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
22
|
+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
23
|
+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
24
|
+
|
|
25
|
+
/* Strict Type-Checking Options */
|
|
26
|
+
"strict": true /* Enable all strict type-checking options. */,
|
|
27
|
+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
28
|
+
// "strictNullChecks": true, /* Enable strict null checks. */
|
|
29
|
+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
30
|
+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
31
|
+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
32
|
+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
33
|
+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
34
|
+
|
|
35
|
+
/* Additional Checks */
|
|
36
|
+
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
|
37
|
+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
38
|
+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
39
|
+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
40
|
+
|
|
41
|
+
/* Module Resolution Options */
|
|
42
|
+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
43
|
+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
44
|
+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
45
|
+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
46
|
+
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
47
|
+
// "types": ["index.d.ts"] /* Type declaration files to be included in compilation. */,
|
|
48
|
+
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
|
|
49
|
+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
50
|
+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
51
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
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
|
+
}
|
package/tslint.json
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"rules": {
|
|
3
|
+
// -- Strict errors --
|
|
4
|
+
// These lint rules are likely always a good idea.
|
|
5
|
+
|
|
6
|
+
// Force function overloads to be declared together. This ensures readers understand APIs.
|
|
7
|
+
"adjacent-overload-signatures": true,
|
|
8
|
+
|
|
9
|
+
// Do not allow the subtle/obscure comma operator.
|
|
10
|
+
"ban-comma-operator": true,
|
|
11
|
+
|
|
12
|
+
// Do not allow internal modules or namespaces . These are deprecated in favor of ES6 modules.
|
|
13
|
+
"no-namespace": true,
|
|
14
|
+
|
|
15
|
+
// Do not allow parameters to be reassigned. To avoid bugs, developers should instead assign new values to new vars.
|
|
16
|
+
"no-parameter-reassignment": true,
|
|
17
|
+
|
|
18
|
+
// Force the use of ES6-style imports instead of /// <reference path=> imports.
|
|
19
|
+
"no-reference": true,
|
|
20
|
+
|
|
21
|
+
// Do not allow type assertions that do nothing. This is a big warning that the developer may not understand the
|
|
22
|
+
// code currently being edited (they may be incorrectly handling a different type case that does not exist).
|
|
23
|
+
"no-unnecessary-type-assertion": true,
|
|
24
|
+
|
|
25
|
+
// Disallow nonsensical label usage.
|
|
26
|
+
"label-position": true,
|
|
27
|
+
|
|
28
|
+
// Disallows the (often typo) syntax if (var1 = var2). Replace with if (var2) { var1 = var2 }.
|
|
29
|
+
"no-conditional-assignment": true,
|
|
30
|
+
|
|
31
|
+
// Disallows constructors for primitive types (e.g. new Number('123'), though Number('123') is still allowed).
|
|
32
|
+
"no-construct": true,
|
|
33
|
+
|
|
34
|
+
// Do not allow super() to be called twice in a constructor.
|
|
35
|
+
"no-duplicate-super": true,
|
|
36
|
+
|
|
37
|
+
// Do not allow the same case to appear more than once in a switch block.
|
|
38
|
+
"no-duplicate-switch-case": true,
|
|
39
|
+
|
|
40
|
+
// Do not allow a variable to be declared more than once in the same block. Consider function parameters in this
|
|
41
|
+
// rule.
|
|
42
|
+
"no-duplicate-variable": [true, "check-parameters"],
|
|
43
|
+
|
|
44
|
+
// Disallows a variable definition in an inner scope from shadowing a variable in an outer scope. Developers should
|
|
45
|
+
// instead use a separate variable name.
|
|
46
|
+
"no-shadowed-variable": true,
|
|
47
|
+
|
|
48
|
+
// Empty blocks are almost never needed. Allow the one general exception: empty catch blocks.
|
|
49
|
+
"no-empty": [true, "allow-empty-catch"],
|
|
50
|
+
|
|
51
|
+
// Functions must either be handled directly (e.g. with a catch() handler) or returned to another function.
|
|
52
|
+
// This is a major source of errors in Cloud Functions and the team strongly recommends leaving this rule on.
|
|
53
|
+
"no-floating-promises": true,
|
|
54
|
+
|
|
55
|
+
// Do not allow any imports for modules that are not in package.json. These will almost certainly fail when
|
|
56
|
+
// deployed.
|
|
57
|
+
"no-implicit-dependencies": true,
|
|
58
|
+
|
|
59
|
+
// The 'this' keyword can only be used inside of classes.
|
|
60
|
+
"no-invalid-this": true,
|
|
61
|
+
|
|
62
|
+
// Do not allow strings to be thrown because they will not include stack traces. Throw Errors instead.
|
|
63
|
+
"no-string-throw": true,
|
|
64
|
+
|
|
65
|
+
// Disallow control flow statements, such as return, continue, break, and throw in finally blocks.
|
|
66
|
+
"no-unsafe-finally": true,
|
|
67
|
+
|
|
68
|
+
// Do not allow variables to be used before they are declared.
|
|
69
|
+
"no-use-before-declare": true,
|
|
70
|
+
|
|
71
|
+
// Expressions must always return a value. Avoids common errors like const myValue = functionReturningVoid();
|
|
72
|
+
"no-void-expression": [true, "ignore-arrow-function-shorthand"],
|
|
73
|
+
|
|
74
|
+
// Disallow duplicate imports in the same file.
|
|
75
|
+
"no-duplicate-imports": true,
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// -- Strong Warnings --
|
|
79
|
+
// These rules should almost never be needed, but may be included due to legacy code.
|
|
80
|
+
// They are left as a warning to avoid frustration with blocked deploys when the developer
|
|
81
|
+
// understand the warning and wants to deploy anyway.
|
|
82
|
+
|
|
83
|
+
// Warn when an empty interface is defined. These are generally not useful.
|
|
84
|
+
"no-empty-interface": {"severity": "warning"},
|
|
85
|
+
|
|
86
|
+
// Warn when an import will have side effects.
|
|
87
|
+
"no-import-side-effect": {"severity": "warning"},
|
|
88
|
+
|
|
89
|
+
// Warn when variables are defined with var. Var has subtle meaning that can lead to bugs. Strongly prefer const for
|
|
90
|
+
// most values and let for values that will change.
|
|
91
|
+
"no-var-keyword": {"severity": "warning"},
|
|
92
|
+
|
|
93
|
+
// Prefer === and !== over == and !=. The latter operators support overloads that are often accidental.
|
|
94
|
+
"triple-equals": {"severity": "warning"},
|
|
95
|
+
|
|
96
|
+
// Warn when using deprecated APIs.
|
|
97
|
+
"deprecation": {"severity": "warning"},
|
|
98
|
+
|
|
99
|
+
// -- Light Warnings --
|
|
100
|
+
// These rules are intended to help developers use better style. Simpler code has fewer bugs. These would be "info"
|
|
101
|
+
// if TSLint supported such a level.
|
|
102
|
+
|
|
103
|
+
// prefer for( ... of ... ) to an index loop when the index is only used to fetch an object from an array.
|
|
104
|
+
// (Even better: check out utils like .map if transforming an array!)
|
|
105
|
+
"prefer-for-of": {"severity": "warning"},
|
|
106
|
+
|
|
107
|
+
// Warns if function overloads could be unified into a single function with optional or rest parameters.
|
|
108
|
+
"unified-signatures": {"severity": "warning"},
|
|
109
|
+
|
|
110
|
+
// Prefer const for values that will not change. This better documents code.
|
|
111
|
+
"prefer-const": {"severity": "warning"},
|
|
112
|
+
|
|
113
|
+
// Multi-line object literals and function calls should have a trailing comma. This helps avoid merge conflicts.
|
|
114
|
+
"trailing-comma": {"severity": "warning"}
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
"defaultSeverity": "error"
|
|
118
|
+
}
|