Skip to content

Commit

Permalink
Fix and improve staged linting
Browse files Browse the repository at this point in the history
  • Loading branch information
marcbouchenoire committed Dec 31, 2021
1 parent 2f6852f commit a6e70cf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 41 deletions.
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"publishConfig": {
"access": "public"
},
"packages": [
"packages/*"
],
"packages": ["packages/*"],
"useWorkspaces": true,
"version": "1.2.0",
"command": {
Expand Down
38 changes: 36 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,42 @@
"name": "",
"private": true,
"prettier": "@marcbouchenoire/prettier-config",
"nano-staged": {
"*.{json,md,yml}": [
"yarn prettier"
],
"packages/symbolist/**/*.mjs": [
"yarn workspace symbolist eslint --fix",
"yarn workspace symbolist prettier"
],
"packages/symbolist/**/*.{ts,tsx}": [
"yarn workspace symbolist eslint --fix",
"yarn workspace symbolist tsatsiki --project tsconfig.json declarations.d.ts",
"yarn workspace symbolist prettier"
],
"packages/symbolist/**/*.{json,md}": [
"yarn workspace symbolist prettier"
],
"packages/site/**/*.{cjs,mjs}": [
"yarn workspace site eslint --fix",
"yarn workspace site prettier"
],
"packages/site/**/*.{ts,tsx}": [
"yarn workspace site eslint --fix",
"yarn workspace site tsatsiki --project tsconfig.json next-env.d.ts declarations.d.ts",
"yarn workspace site prettier"
],
"packages/site/**/*.css": [
"yarn workspace site stylelint --fix",
"yarn workspace site prettier"
],
"packages/site/**/*.{json,md}": [
"yarn workspace site prettier"
]
},
"husky": {
"hooks": {
"pre-commit": "lerna run --concurrency 1 --stream nano-staged --since HEAD --exclude-dependents"
"pre-commit": "nano-staged"
}
},
"engines": {
Expand All @@ -17,11 +50,12 @@
"site:dev": "yarn workspace site dev",
"site:build": "yarn workspace site build",
"site:publish": "yarn build && yarn site:build",
"prettier": "prettier --write --loglevel silent --ignore-path .gitignore",
"generate": "yarn workspace symbolist generate",
"build": "yarn workspace symbolist build",
"test": "yarn workspace symbolist test",
"test:coverage": "yarn workspace symbolist test:coverage",
"lint": "lerna run lint --stream",
"lint": "yarn prettier '*.{json,md,yml}' && lerna run lint --stream",
"release": "yarn test && lerna publish"
},
"devDependencies": {
Expand Down
21 changes: 1 addition & 20 deletions packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,13 @@
"name": "site",
"version": "1.2.0",
"private": true,
"nano-staged": {
"**/*.{cjs,mjs}": [
"eslint --fix",
"yarn prettier"
],
"**/*.{ts,tsx}": [
"eslint --fix",
"tsatsiki --project tsconfig.json next-env.d.ts declarations.d.ts",
"yarn prettier"
],
"**/*.css": [
"stylelint --fix",
"yarn prettier"
],
"**/*.{json,md,yml}": [
"yarn prettier"
]
},
"scripts": {
"dev": "next dev",
"build": "next build",
"nano-staged": "nano-staged",
"prettier": "prettier --write --loglevel silent --ignore-path .eslintignore",
"lint": "yarn lint:eslint && yarn lint:stylelint && yarn lint:tsc && yarn lint:prettier",
"lint:eslint": "eslint '**/*.{cjs,mjs,ts,tsx}' --fix",
"lint:prettier": "yarn prettier '**/*.{cjs,mjs,ts,tsx,json,md,yml,css}'",
"lint:prettier": "yarn prettier '**/*.{cjs,mjs,ts,tsx,json,md,css}'",
"lint:stylelint": "stylelint '**/*.css' --fix",
"lint:tsc": "tsc --project tsconfig.json"
},
Expand Down
17 changes: 1 addition & 16 deletions packages/symbolist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,12 @@
"./package.json": "./package.json"
},
"types": "./dist/index.d.ts",
"nano-staged": {
"**/*.mjs": [
"eslint --fix",
"yarn prettier"
],
"**/*.{ts,tsx}": [
"eslint --fix",
"tsatsiki --project tsconfig.json declarations.d.ts",
"yarn prettier"
],
"**/*.{json,md,yml}": [
"yarn prettier"
]
},
"scripts": {
"build": "microbundle --tsconfig tsconfig.build.json",
"nano-staged": "nano-staged",
"prettier": "prettier --write --loglevel silent --ignore-path .eslintignore",
"lint": "yarn lint:eslint && yarn lint:tsc && yarn lint:prettier",
"lint:eslint": "eslint '**/*.{mjs,ts,tsx}' --fix",
"lint:prettier": "yarn prettier '**/*.{mjs,ts,tsx,json,md,yml}'",
"lint:prettier": "yarn prettier '**/*.{mjs,ts,tsx,json,md}'",
"lint:tsc": "tsc --project tsconfig.json",
"generate": "node --loader tsm scripts/generate.ts && yarn prettier 'src/data/*.{ts,json}'",
"prepublishOnly": "yarn build",
Expand Down

0 comments on commit a6e70cf

Please sign in to comment.