Skip to content

Commit 6367338

Browse files
author
Flavio Sampaio
committed
Apply new environment setup
1 parent 6fa5a44 commit 6367338

File tree

7 files changed

+443
-245
lines changed

7 files changed

+443
-245
lines changed

.eslintrc

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"root": true,
33
"parser": "@typescript-eslint/parser",
4-
"plugins": [
5-
"@typescript-eslint"
6-
],
4+
"plugins": ["@typescript-eslint"],
75
"extends": [
86
"eslint:recommended",
97
"plugin:@typescript-eslint/eslint-recommended",
108
"plugin:@typescript-eslint/recommended"
119
],
12-
"rules": { // 0 = off, 1 = warn, 2 = error
10+
"rules": {
11+
// 0 = off, 1 = warn, 2 = error
12+
"@typescript-eslint/explicit-module-boundary-types": "off",
1313
"accessor-pairs": "error",
1414
"array-bracket-newline": "off",
1515
"array-bracket-spacing": "error",
@@ -25,10 +25,10 @@
2525
"camelcase": "error",
2626
"capitalized-comments": "error",
2727
"class-methods-use-this": "error",
28-
"comma-dangle": "error",
28+
"comma-dangle": "off",
2929
"comma-spacing": "error",
3030
"comma-style": "error",
31-
"complexity": "error",
31+
"complexity": "off",
3232
"computed-property-spacing": "error",
3333
"consistent-return": "error",
3434
"consistent-this": "error",
@@ -46,8 +46,8 @@
4646
"func-name-matching": "error",
4747
"func-names": "error",
4848
"func-style": "error",
49-
"function-call-argument-newline": "error",
50-
"function-paren-newline": "error",
49+
"function-call-argument-newline": "off",
50+
"function-paren-newline": "off",
5151
"generator-star-spacing": "error",
5252
"getter-return": "error",
5353
"global-require": "error",
@@ -56,7 +56,7 @@
5656
"handle-callback-err": "error",
5757
"id-blacklist": "error",
5858
"id-denylist": "error",
59-
"id-length": "error",
59+
"id-length": "off",
6060
"id-match": "error",
6161
"implicit-arrow-linebreak": "error",
6262
"indent": "off",
@@ -65,9 +65,9 @@
6565
"jsx-quotes": "error",
6666
"key-spacing": "error",
6767
"keyword-spacing": "error",
68-
"line-comment-position": "error",
68+
"line-comment-position": "off",
6969
"linebreak-style": "error",
70-
"lines-around-comment": "error",
70+
"lines-around-comment": "off",
7171
"lines-around-directive": "error",
7272
"lines-between-class-members": "off",
7373
"max-classes-per-file": "error",
@@ -132,7 +132,7 @@
132132
"no-extra-bind": "error",
133133
"no-extra-boolean-cast": "off",
134134
"no-extra-label": "error",
135-
"no-extra-parens": "error",
135+
"no-extra-parens": "off",
136136
"no-extra-semi": "error",
137137
"no-fallthrough": "error",
138138
"no-floating-decimal": "error",
@@ -142,7 +142,7 @@
142142
"no-implicit-globals": "error",
143143
"no-implied-eval": "error",
144144
"no-import-assign": "error",
145-
"no-inline-comments": "error",
145+
"no-inline-comments": "off",
146146
"no-inner-declarations": "error",
147147
"no-invalid-regexp": "error",
148148
"no-invalid-this": "off",
@@ -156,7 +156,7 @@
156156
"no-loss-of-precision": "error",
157157
"no-magic-numbers": "off",
158158
"no-misleading-character-class": "error",
159-
"no-mixed-operators": "error",
159+
"no-mixed-operators": "off",
160160
"no-mixed-requires": "error",
161161
"no-mixed-spaces-and-tabs": "error",
162162
"no-multi-assign": "error",
@@ -231,7 +231,7 @@
231231
"no-useless-computed-key": "error",
232232
"no-useless-concat": "error",
233233
"no-useless-constructor": "error",
234-
"no-useless-escape": "error",
234+
"no-useless-escape": "off",
235235
"no-useless-rename": "error",
236236
"no-useless-return": "error",
237237
"no-var": "error",
@@ -258,7 +258,7 @@
258258
"prefer-numeric-literals": "error",
259259
"prefer-object-spread": "error",
260260
"prefer-promise-reject-errors": "error",
261-
"prefer-reflect": "error",
261+
"prefer-reflect": "off",
262262
"prefer-regex-literals": "error",
263263
"prefer-rest-params": "error",
264264
"prefer-spread": "error",
@@ -275,7 +275,7 @@
275275
"require-atomic-updates": "error",
276276
"require-await": "error",
277277
"require-jsdoc": "error",
278-
"require-unicode-regexp": "error",
278+
"require-unicode-regexp": "off",
279279
"require-yield": "error",
280280
"rest-spread-spacing": "error",
281281
"semi": "error",
@@ -305,4 +305,4 @@
305305
"yield-star-spacing": "error",
306306
"yoda": 2
307307
}
308-
}
308+
}

.github/PULL_REQUEST_TEMPLATE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Changes
2+
_List Changes Introduced by this PR_
3+
1. Item 1
4+
2. Item 2
5+
6+
## Purpose
7+
_Describe the problem or feature._
8+
9+
## Approach
10+
_How does this change address the problem?_
11+
12+
## Learning
13+
_Describe the research stage_
14+
_Links to blog posts, patterns, libraries or addons used to solve this problem_
15+
16+
## Screenshots
17+
_Add screenshot if have one_
18+
19+
20+
_If this closes an issue, reference the issue here. If it doesn't, remove this line_
21+
Closes #

src/environments/environment.prod.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
const production = true;
22

3-
const automaticLogin = { email: "", password: "" };
4-
const apiPrefix = "http://192.168.10.106:8000/wp-json/wp/v2";
3+
const automaticLogin = {
4+
email: '',
5+
password: ''
6+
};
7+
const apiPrefix = 'http://192.168.10.106:8000/wp-json/wp/v2';
58
const hideLogs = true;
69

7-
export {
10+
export const environment = {
811
apiPrefix,
912
automaticLogin,
1013
hideLogs,
11-
production,
14+
production
1215
};

src/environments/environment.stage.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
const production = true;
22

3-
const automaticLogin = { email: "", password: "" };
4-
const apiPrefix = "http://192.168.10.106:8000/wp-json/wp/v2";
3+
const automaticLogin = {
4+
email: '',
5+
password: ''
6+
};
7+
const apiPrefix = 'http://192.168.10.106:8000/wp-json/wp/v2';
58
const hideLogs = true;
69

7-
export {
10+
export const environment = {
811
apiPrefix,
912
automaticLogin,
1013
hideLogs,
11-
production,
14+
production
1215
};

src/environments/environment.tns.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { environment as devEnvironment } from './environment.dev';
2+
import { environment as prodEnvironment } from './environment.prod';
3+
import { environment as stageEnvironment } from './environment.stage';
4+
5+
export const environment = (() => {
6+
let envVars;
7+
8+
if (Object.prototype.hasOwnProperty.call(process.env, 'environment') &&
9+
process.env.environment
10+
) {
11+
switch (process.env.environment) {
12+
case 'prod':
13+
envVars = prodEnvironment;
14+
break;
15+
case 'stage':
16+
envVars = stageEnvironment;
17+
break;
18+
default:
19+
envVars = devEnvironment;
20+
}
21+
}
22+
else {
23+
envVars = devEnvironment;
24+
}
25+
26+
return envVars;
27+
})();

src/environments/environment.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as env from "./environment.dev";
1+
import * as env from './environment.dev';
22

3-
const sentryDSN = "https://[email protected]/9999999";
3+
const sentryDSN = 'https://[email protected]/9999999';
44

55
export const environment = {
66
sentryDSN,

0 commit comments

Comments
 (0)