Skip to content

Commit

Permalink
Add prettier configuration for wider lines & CRLF endings
Browse files Browse the repository at this point in the history
Add *js in editorconfig
  • Loading branch information
Philippluca committed Oct 20, 2023
1 parent 45a9cb2 commit 37fc2d6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dotnet_sort_system_directives_first = false
[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}]
indent_size = 2

[*.{json,js}]
[*.{json,*js}]
indent_size = 2

# license-checker config file
Expand Down
8 changes: 7 additions & 1 deletion src/GeoCop.Frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ module.exports = {
settings: { react: { version: '18.2' } },
plugins: ['react-refresh', 'prettier'],
rules: {
'prettier/prettier': 'error',
'prettier/prettier': [
'error',
{
printWidth: 120,
endOfLine: "auto"
}
],
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
Expand Down
24 changes: 5 additions & 19 deletions src/GeoCop.Frontend/aspnetcore-https.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ const baseFolder =
? `${process.env.APPDATA}/ASP.NET/https`
: `${process.env.HOME}/.aspnet/https`;

const certificateArg = process.argv
.map((arg) => arg.match(/--name=(?<value>.+)/i))
.filter(Boolean)[0];
const certificateName = certificateArg
? certificateArg.groups.value
: process.env.npm_package_name;
const certificateArg = process.argv.map((arg) => arg.match(/--name=(?<value>.+)/i)).filter(Boolean)[0];
const certificateName = certificateArg ? certificateArg.groups.value : process.env.npm_package_name;

if (!certificateName) {
console.error(
Expand All @@ -27,17 +23,7 @@ const certFilePath = path.join(baseFolder, `${certificateName}.pem`);
const keyFilePath = path.join(baseFolder, `${certificateName}.key`);

if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) {
spawn(
"dotnet",
[
"dev-certs",
"https",
"--export-path",
certFilePath,
"--format",
"Pem",
"--no-password",
],
{ stdio: "inherit" },
).on("exit", (code) => process.exit(code));
spawn("dotnet", ["dev-certs", "https", "--export-path", certFilePath, "--format", "Pem", "--no-password"], {
stdio: "inherit",
}).on("exit", (code) => process.exit(code));
}
8 changes: 2 additions & 6 deletions src/GeoCop.Frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ const baseFolder =
? `${process.env.APPDATA}/ASP.NET/https`
: `${process.env.HOME}/.aspnet/https`;

const certificateArg = process.argv
.map((arg) => arg.match(/--name=(?<value>.+)/i))
.filter(Boolean)[0];
const certificateName = certificateArg
? certificateArg.groups.value
: "reactapp";
const certificateArg = process.argv.map((arg) => arg.match(/--name=(?<value>.+)/i)).filter(Boolean)[0];
const certificateName = certificateArg ? certificateArg.groups.value : "reactapp";

if (!certificateName) {
console.error(
Expand Down

0 comments on commit 37fc2d6

Please sign in to comment.