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 Nov 28, 2024
1 parent a27bd72 commit 7b90b41
Show file tree
Hide file tree
Showing 24 changed files with 7,733 additions and 7,593 deletions.
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/node_modules
**/.git
*.html
*.js
*.json
*.md
*.ts
*.yml
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"
}
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 @@ -109,6 +109,7 @@
"karma-jasmine-html-reporter": "^2.0.0",
"karma-junit-reporter": "1.2.0",
"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 7b90b41

Please sign in to comment.