Skip to content

Commit

Permalink
build: Use prettier for javascript
Browse files Browse the repository at this point in the history
Stop ignoring .js and .json files in prettier and fix existing issues.

The `prettier-plugin-multiline-arrays` plugin is used to split arrays
with multiple elements into one line per element.
  • Loading branch information
rhopman committed Dec 19, 2024
1 parent c5fc392 commit e36ab0e
Show file tree
Hide file tree
Showing 26 changed files with 7,771 additions and 7,609 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/user-story-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ As DevOps I want Health liveness Probe on the microservice so that the health of
**Acceptance Criteria:**

- [ ] [LIST ITEMS]
i.e.
i.e.

- [ ] Negative use-cases for Unit Tests in the "common streaming library"
- [ ] Integration tests in the "common streaming library"
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
/node_modules
**/.git
*.html
*.js
*.json
*.ts
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"multilineArraysWrapThreshold": 1,
"plugins": [
"prettier-plugin-multiline-arrays"
],
"singleQuote": true,
"trailingComma": "none"
}
32 changes: 27 additions & 5 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-recommended-scss"],
"extends": [
"stylelint-config-standard",
"stylelint-config-recommended-scss"
],
"rules": {
"font-family-name-quotes": "always-where-recommended",
"font-family-no-missing-generic-family-keyword": [true, { "ignoreFontFamilies": ["FontAwesome"] }],
"font-family-no-missing-generic-family-keyword": [
true,
{ "ignoreFontFamilies": ["FontAwesome"] }],
"function-url-quotes": [
"always",
{
Expand All @@ -16,7 +21,9 @@
"declaration-no-important": null,
"at-rule-no-vendor-prefix": true,
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": [true, { "ignoreAtRules": ["tailwind"] }],
"scss/at-rule-no-unknown": [
true,
{ "ignoreAtRules": ["tailwind"] }],
"media-feature-name-no-vendor-prefix": true,
"property-no-vendor-prefix": true,
"selector-no-vendor-prefix": true,
Expand All @@ -35,7 +42,12 @@
"selector-type-no-unknown": [
true,
{
"ignoreTypes": ["/^mat/", "/^mifosx/", "fa-icon", "ng-template"]
"ignoreTypes": [
"/^mat/",
"/^mifosx/",
"fa-icon",
"ng-template"
]
}
],
"selector-pseudo-element-no-unknown": [
Expand All @@ -44,6 +56,16 @@
"ignorePseudoElements": ["ng-deep"]
}
],
"unit-allowed-list": ["px", "%", "em", "rem", "vw", "vh", "deg", "s", "ms"]
"unit-allowed-list": [
"px",
"%",
"em",
"rem",
"vw",
"vh",
"deg",
"s",
"ms"
]
}
}
2 changes: 1 addition & 1 deletion e2e/cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"pluginsFile": "e2e/cypress/plugins/index.ts",
"fixturesFolder": "e2e/cypress/fixtures",
"baseUrl": "http://localhost:4200"
}
}
4 changes: 2 additions & 2 deletions e2e/protractor.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports.config = {
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': process.env.PROTRACTOR_BROWSER || 'chrome'
browserName: process.env.PROTRACTOR_BROWSER || 'chrome'
},
// Only works with Chrome and Firefox
directConnect: true,
Expand All @@ -18,7 +18,7 @@ exports.config = {
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 60000,
print: function() {}
print: function () {}
},
onPrepare() {
require('ts-node').register({
Expand Down
13 changes: 6 additions & 7 deletions e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"extends": "../tsconfig.json",
"include": ["**/*.ts"],
"compilerOptions": {
"sourceMap": false,
"types": ["cypress"]
}
"extends": "../tsconfig.json",
"include": ["**/*.ts"],
"compilerOptions": {
"sourceMap": false,
"types": ["cypress"]
}
}

2 changes: 1 addition & 1 deletion ngcc.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ module.exports = {
ignorableDeepImportMatchers: [
/@ckeditor\//
]
},
}
}
};
134 changes: 134 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"karma-junit-reporter": "1.2.0",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"prettier-plugin-multiline-arrays": "^3.0.6",
"protractor": "~7.0.0",
"puppeteer": "^15.3.2",
"stylelint": "^16.10.0",
Expand Down
4 changes: 3 additions & 1 deletion proxy.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function setupForCorporateProxy(proxyConfig) {
if (proxyServer) {
console.log(`Using corporate proxy server: ${proxyServer}`);
agent = new HttpsProxyAgent(proxyServer);
proxyConfig.forEach(entry => { entry.agent = agent; });
proxyConfig.forEach((entry) => {
entry.agent = agent;
});
}

return proxyConfig;
Expand Down
21 changes: 10 additions & 11 deletions src/assets/env.template.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
(function(window) {
window["env"] = window["env"] || {};
(function (window) {
window['env'] = window['env'] || {};

// BackEnd Environment variables
window["env"]["fineractApiUrls"] = '$FINERACT_API_URLS';
window["env"]["fineractApiUrl"] = '$FINERACT_API_URL';
window['env']['fineractApiUrls'] = '$FINERACT_API_URLS';
window['env']['fineractApiUrl'] = '$FINERACT_API_URL';

window["env"]["apiProvider"] = '$FINERACT_API_PROVIDER';
window["env"]["apiVersion"] = '$FINERACT_API_VERSION';
window['env']['apiProvider'] = '$FINERACT_API_PROVIDER';
window['env']['apiVersion'] = '$FINERACT_API_VERSION';

window["env"]["fineractPlatformTenantId"] = '$FINERACT_PLATFORM_TENANT_IDENTIFIER';
window["env"]["fineractPlatformTenantIds"] = '$FINERACT_PLATFORM_TENANTS_IDENTIFIER';
window['env']['fineractPlatformTenantId'] = '$FINERACT_PLATFORM_TENANT_IDENTIFIER';
window['env']['fineractPlatformTenantIds'] = '$FINERACT_PLATFORM_TENANTS_IDENTIFIER';

// Language Environment variables
window["env"]["defaultLanguage"] = '$MIFOS_DEFAULT_LANGUAGE';
window["env"]["supportedLanguages"] = '$MIFOS_SUPPORTED_LANGUAGES';
window['env']['defaultLanguage'] = '$MIFOS_DEFAULT_LANGUAGE';
window['env']['supportedLanguages'] = '$MIFOS_SUPPORTED_LANGUAGES';

window['env']['preloadClients'] = '$MIFOS_PRELOAD_CLIENTS';

Expand All @@ -34,5 +34,4 @@

// Time in milliseconds for Session idle timeout, default 300000 seconds
window['env']['sessionIdleTimeout'] = '$MIFOS_SESSION_IDLE_TIMEOUT';

})(this);
Loading

0 comments on commit e36ab0e

Please sign in to comment.