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

Mrc 4694 : Prettier Setup #203

Merged
merged 8 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
run: npm run lint --prefix=app/server
- name: Lint front end
run: npm run lint --prefix=app/static
- name: Check formatting frontend
run: npm run format:check --prefix=app/static
- name: Check versions
run: npm run genversion --prefix=app/server -- --check-only
- name: Upload coverage
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/.idea/
/.vscode/
/app/server/coverage/
/app/server/node_modules/
/app/server/public/css/
Expand Down
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"r.lsp.promptToInstall": false,
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"editor.formatOnPaste": false, // required
"editor.formatOnType": false, // required
"editor.formatOnSave": true, // optional
"editor.formatOnSaveMode": "file", // required to format on save
"files.autoSave": "onFocusChange", // optional but recommended
"vs-code-prettier-eslint.prettierLast": "false" // set as "true" to run 'prettier' last not first

}
41 changes: 18 additions & 23 deletions app/static/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ module.exports = {
env: {
node: true
},
extends: [
"plugin:vue/vue3-essential",
"@vue/airbnb",
"@vue/typescript/recommended"
],
extends: ["plugin:vue/vue3-essential", "@vue/airbnb", "@vue/typescript/recommended", "prettier"],
parserOptions: {
ecmaVersion: 2020
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"comma-dangle": ["error", "never"],
indent: ["error", 4],
quotes: ["error", "double", { avoidEscape: true }],
"max-len": [2, 120, 4],
"arrow-body-style": "off",
Expand All @@ -27,24 +21,25 @@ module.exports = {
"no-underscore-dangle": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"no-await-in-loop": "off"
"no-await-in-loop": "off",
"no-useless-concat": "off"
},
overrides: [{
files: [
"**/tests/**/*.{j,t}s"
],
env: {
jest: true
},
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-empty-function": "off",
"max-classes-per-file": "off",
"no-useless-constructor": "off"
overrides: [
{
files: ["**/tests/**/*.{j,t}s"],
env: {
jest: true
},
rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-empty-function": "off",
"max-classes-per-file": "off",
"no-useless-constructor": "off"
}
}
}],
],
globals: {
NodeJS: true
}
Expand Down
6 changes: 6 additions & 0 deletions app/static/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore artifacts:
build
coverage
test-results
node_modules
dist
8 changes: 8 additions & 0 deletions app/static/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": true,
"tabWidth": 4,
"singleQuote": false,
"printWidth": 120,
"trailingComma": "none"
}
4 changes: 1 addition & 3 deletions app/static/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module.exports = {
presets: [
"@vue/cli-plugin-babel/preset"
]
presets: ["@vue/cli-plugin-babel/preset"]
};
2 changes: 1 addition & 1 deletion app/static/hotReload/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require("path");
const baseConfig = require("../vue.config");
const WebpackShellPlugin = require('webpack-shell-plugin');
const WebpackShellPlugin = require("webpack-shell-plugin");

module.exports = {
...baseConfig,
Expand Down
8 changes: 2 additions & 6 deletions app/static/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ module.exports = {
"\\.md$": "jest-raw-loader"
},
collectCoverage: true,
testMatch: [
"**/?(*.)test.(js|ts)"
],
coveragePathIgnorePatterns: [
"./tests/mocks.ts"
],
testMatch: ["**/?(*.)test.(js|ts)"],
coveragePathIgnorePatterns: ["./tests/mocks.ts"],
transformIgnorePatterns: ["node_modules/(?!(d3-format))"],
moduleNameMapper: {
"raw-loader!.*/help/(.*)$": "<rootDir>/src/app/help/$1"
Expand Down
Loading