Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lib: Use prettier to format our files #198

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ body:
label: What version of ODS Charts are you using?
placeholder: "e.g., v1.0.0"
validations:
required: true
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ body:
label: Motivation and context
description: Tell us why this change is needed or helpful, and what problems it may help solve.
validations:
required: true
required: true
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ updates:
groups:
angular-ngx-echarts-all-deps:
patterns:
- "*"
- "*"
- package-ecosystem: npm
directory: "/test/angular-echarts"
labels:
Expand All @@ -41,7 +41,7 @@ updates:
groups:
angular-echarts-all-deps:
patterns:
- "*"
- "*"
- package-ecosystem: npm
directory: "/test/react"
labels:
Expand All @@ -52,7 +52,7 @@ updates:
groups:
react-all-deps:
patterns:
- "*"
- "*"
- package-ecosystem: npm
directory: "/test/vue"
labels:
Expand All @@ -63,4 +63,4 @@ updates:
groups:
vue-all-deps:
patterns:
- "*"
- "*"
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Files to ignore
**/.angular
24 changes: 24 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"bracketSameLine": true,
"printWidth": 160,
"quoteProps": "consistent",
"semi": true,
"singleAttributePerLine": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"overrides": [
{
"files": ["*.css", "*.yml"],
"options": {
"singleQuote": false
}
},
{
"files": ["*.css", "*.html"],
"options": {
"printWidth": 500
}
}
]
}
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand Down
1 change: 1 addition & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ npm run serve
```

The server will be available at `http://localhost:3000/`:

- Test files are located at `http://localhost:3000/test`.
- Documentation is located at `http://localhost:3000/docs`.
17 changes: 10 additions & 7 deletions build/add_head.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from "node:fs";
import path from "node:path";
import fs from 'node:fs';
import path from 'node:path';

function fromDir(startPath, filter, prefix = '../') {
const favicon = `
Expand All @@ -26,10 +26,13 @@ function fromDir(startPath, filter, prefix = '../') {
if (stat.isDirectory()) {
fromDir(filename, filter, `${prefix}../`);
} else if (filename.endsWith(filter)) {
fs.writeFileSync(filename, fs.readFileSync(filename).toString().replace("<head>", `<head>${boosted_CSS}${favicon}`).replace("</body>", `\n${cookies}\n</body>`));
};
};
};
fs.writeFileSync(
filename,
fs.readFileSync(filename).toString().replace('<head>', `<head>${boosted_CSS}${favicon}`).replace('</body>', `\n${cookies}\n</body>`)
);
}
}
}

console.log(`\n\nAdding cookies to API files\n`)
console.log(`\n\nAdding cookies to API files\n`);
fromDir('./docs/api', '.html');
20 changes: 13 additions & 7 deletions build/bump-copyright-year.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import fs from "node:fs";
import path from "node:path";
import fs from 'node:fs';
import path from 'node:path';

function fromDir(startPath, filter) {
var files = fs.readdirSync(startPath);
for (var i = 0; i < files.length; i++) {
var filename = path.join(startPath, files[i]);
var stat = fs.lstatSync(filename);
if (stat.isDirectory() && !filename.endsWith("node_modules") && !filename.endsWith("dist") && !filename.endsWith("docs/api")) {
if (stat.isDirectory() && !filename.endsWith('node_modules') && !filename.endsWith('dist') && !filename.endsWith('docs/api')) {
fromDir(filename, filter);
} else if (filename.endsWith(filter)) {
console.log(`Bump copyright year in ${filename}`);
fs.writeFileSync(filename, fs.readFileSync(filename).toString().replaceAll(/(\d{4,} - )\d{4,}/g, `$1${new Date().getFullYear()}`));
};
};
};
fs.writeFileSync(
filename,
fs
.readFileSync(filename)
.toString()
.replaceAll(/(\d{4,} - )\d{4,}/g, `$1${new Date().getFullYear()}`)
);
}
}
}

console.log(`Bump copyright year\n`);
fromDir('./src', '');
Expand Down
Loading