Skip to content

Commit

Permalink
Refactor prettier formatting to run from root (#2959)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot authored Nov 12, 2024
1 parent a418b58 commit f0a2df9
Show file tree
Hide file tree
Showing 35 changed files with 13 additions and 978 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ jobs:
onlyDiff: "true"
header: "Bundle size report" # PR comment header

format:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Format
run: pnpm format

lint:
needs: [build]
runs-on: ubuntu-latest
Expand Down
11 changes: 8 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.cache
.changeset
.expo
.storybook
.wireit
.vscode
coverage
dist
Expand All @@ -10,12 +15,12 @@ node_modules
npm-debug.log*
lerna-debug.log*
yarn-error.log*
.cache
lerna.json
tsconfig.json
tsconfig.*.json
storybook-static
public
artifacts
.expo
.wireit
stories
demo
website
13 changes: 0 additions & 13 deletions package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ module.exports = {
"build:dist:min":
"webpack --bail --config ../../config/webpack/webpack.config.js",

// Quality.
// - Format
// TODO(2375): Can we cache / incremental?
// https://github.com/FormidableLabs/victory/issues/2375
"format:pkg":
'prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --list-different "./**/*.{js,jsx,json,ts,tsx}"',
"format:pkg:fix":
'prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --write "./**/*.{js,jsx,json,ts,tsx}"',
"format:root":
'prettier --list-different "./*.js*" "./{scripts,config,demo,docs,stories,test}/*.{js,jsx,json,ts,tsx}"',
"format:root:fix":
'prettier --write "./*.js*" "./{scripts,config,demo,docs,stories,test}/*.{js,jsx,json,ts,tsx}"',

// - TypeScript
// TODO(2375): Can we cache / incremental?
// https://github.com/FormidableLabs/victory/issues/2375
Expand Down
124 changes: 5 additions & 119 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
},
"homepage": "https://commerce.nearform.com/open-source/victory",
"packageManager": "[email protected]",
"dependencies": {
"clsx": "^2.1.1"
},
"devDependencies": {
"@babel/cli": "7.23.9",
"@babel/core": "7.23.9",
Expand Down Expand Up @@ -143,10 +146,6 @@
"build:docs": "wireit",
"format": "wireit",
"format:fix": "wireit",
"format:root": "wireit",
"format:root:fix": "wireit",
"format:pkgs": "wireit",
"format:pkgs:fix": "wireit",
"lint": "wireit",
"lint:fix": "wireit",
"lint:root": "wireit",
Expand Down Expand Up @@ -266,86 +265,10 @@
]
},
"format": {
"dependencies": [
"format:root",
"format:pkgs"
]
"command": "prettier --config .prettierrc.json --ignore-path .prettierignore --check \"./**/*.{js,jsx,json,ts,tsx}\""
},
"format:fix": {
"dependencies": [
"format:root:fix",
"format:pkgs:fix"
]
},
"format:root": {
"command": "nps format:root",
"files": [
"*.js",
"*.json",
"scripts",
"config",
"demo",
"docs",
"stories",
"test",
"!**/node_modules/**"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"format:root:fix": {
"command": "pnpm run format:root || nps format:root:fix",
"files": [
"*.js",
"*.json",
"scripts",
"config",
"demo",
"docs",
"stories",
"test",
"!**/node_modules/**"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"format:pkgs": {
"dependencies": [
"./packages/victory-native:format",
"./packages/victory-vendor:format",
"./packages/victory:format",
"./packages/victory-area:format",
"./packages/victory-axis:format",
"./packages/victory-bar:format",
"./packages/victory-box-plot:format",
"./packages/victory-brush-container:format",
"./packages/victory-brush-line:format",
"./packages/victory-candlestick:format",
"./packages/victory-canvas:format",
"./packages/victory-chart:format",
"./packages/victory-core:format",
"./packages/victory-create-container:format",
"./packages/victory-cursor-container:format",
"./packages/victory-errorbar:format",
"./packages/victory-group:format",
"./packages/victory-histogram:format",
"./packages/victory-legend:format",
"./packages/victory-line:format",
"./packages/victory-pie:format",
"./packages/victory-polar-axis:format",
"./packages/victory-scatter:format",
"./packages/victory-selection-container:format",
"./packages/victory-shared-events:format",
"./packages/victory-stack:format",
"./packages/victory-tooltip:format",
"./packages/victory-voronoi:format",
"./packages/victory-voronoi-container:format",
"./packages/victory-zoom-container:format"
]
"command": "prettier --config .prettierrc.json --ignore-path .prettierignore --write \"./**/*.{js,jsx,json,ts,tsx}\""
},
"lint": {
"dependencies": [
Expand Down Expand Up @@ -540,48 +463,11 @@
"./packages/victory-zoom-container:types:create"
]
},
"format:pkgs:fix": {
"dependencies": [
"./packages/victory-native:format:fix",
"./packages/victory-vendor:format:fix",
"./packages/victory:format:fix",
"./packages/victory-area:format:fix",
"./packages/victory-axis:format:fix",
"./packages/victory-bar:format:fix",
"./packages/victory-box-plot:format:fix",
"./packages/victory-brush-container:format:fix",
"./packages/victory-brush-line:format:fix",
"./packages/victory-candlestick:format:fix",
"./packages/victory-canvas:format:fix",
"./packages/victory-chart:format:fix",
"./packages/victory-core:format:fix",
"./packages/victory-create-container:format:fix",
"./packages/victory-cursor-container:format:fix",
"./packages/victory-errorbar:format:fix",
"./packages/victory-group:format:fix",
"./packages/victory-histogram:format:fix",
"./packages/victory-legend:format:fix",
"./packages/victory-line:format:fix",
"./packages/victory-pie:format:fix",
"./packages/victory-polar-axis:format:fix",
"./packages/victory-scatter:format:fix",
"./packages/victory-selection-container:format:fix",
"./packages/victory-shared-events:format:fix",
"./packages/victory-stack:format:fix",
"./packages/victory-tooltip:format:fix",
"./packages/victory-voronoi:format:fix",
"./packages/victory-voronoi-container:format:fix",
"./packages/victory-zoom-container:format:fix"
]
},
"start:docs": {
"command": "pnpm run --filter victory-docs start",
"dependencies": [
"build:lib:esm"
]
}
},
"dependencies": {
"clsx": "^2.1.1"
}
}
28 changes: 0 additions & 28 deletions packages/victory-area/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
"check": "wireit",
"types:check": "wireit",
"types:create": "wireit",
"format": "wireit",
"format:fix": "wireit",
"lint": "wireit",
"lint:fix": "wireit",
"jest": "wireit"
Expand Down Expand Up @@ -209,32 +207,6 @@
"pnpm-lock.yaml"
]
},
"format": {
"command": "nps format:pkg",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"format:fix": {
"command": "pnpm run format || nps format:pkg:fix",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"lint": {
"command": "eslint src",
"files": [
Expand Down
28 changes: 0 additions & 28 deletions packages/victory-axis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
"check": "wireit",
"types:check": "wireit",
"types:create": "wireit",
"format": "wireit",
"format:fix": "wireit",
"lint": "wireit",
"lint:fix": "wireit",
"jest": "wireit"
Expand Down Expand Up @@ -199,32 +197,6 @@
"pnpm-lock.yaml"
]
},
"format": {
"command": "nps format:pkg",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"format:fix": {
"command": "pnpm run format || nps format:pkg:fix",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"lint": {
"command": "eslint src",
"files": [
Expand Down
28 changes: 0 additions & 28 deletions packages/victory-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
"check": "wireit",
"types:check": "wireit",
"types:create": "wireit",
"format": "wireit",
"format:fix": "wireit",
"lint": "wireit",
"lint:fix": "wireit",
"jest": "wireit"
Expand Down Expand Up @@ -209,32 +207,6 @@
"pnpm-lock.yaml"
]
},
"format": {
"command": "nps format:pkg",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"format:fix": {
"command": "pnpm run format || nps format:pkg:fix",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"lint": {
"command": "eslint src",
"files": [
Expand Down
28 changes: 0 additions & 28 deletions packages/victory-box-plot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
"check": "wireit",
"types:check": "wireit",
"types:create": "wireit",
"format": "wireit",
"format:fix": "wireit",
"lint": "wireit",
"lint:fix": "wireit",
"jest": "wireit"
Expand Down Expand Up @@ -209,32 +207,6 @@
"pnpm-lock.yaml"
]
},
"format": {
"command": "nps format:pkg",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"format:fix": {
"command": "pnpm run format || nps format:pkg:fix",
"files": [
"src/**",
"*.json",
"../../.prettierignore",
"../../.prettierrc.json"
],
"output": [],
"packageLocks": [
"pnpm-lock.yaml"
]
},
"lint": {
"command": "eslint src",
"files": [
Expand Down
Loading

0 comments on commit f0a2df9

Please sign in to comment.