Skip to content

Commit

Permalink
build: configure pretter as formatt for most files
Browse files Browse the repository at this point in the history
  • Loading branch information
n4bb12 committed Sep 1, 2020
1 parent 88604e2 commit 46dccda
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 175 deletions.
29 changes: 8 additions & 21 deletions .eslintignore
@@ -1,24 +1,11 @@
node_modules
**/fixtures/**
**/mock/store/**
**/partials/**
**/types/custom.d.ts
build/
coverage/
wiki/
static/
flow-typed/
node_modules/
static/
website/
build/
*.md
*.lock
*.yaml
Dockerfile
*.rpi
*.html
*.scss
*.png
*.json
*.name
*.tgz
*.jpg
*.sh
**/partials/**
**/fixtures/**
types/custom.d.ts
**/mock/store/**
wiki/
26 changes: 2 additions & 24 deletions .eslintrc
Expand Up @@ -2,18 +2,15 @@
"extends": [
"eslint:recommended",
"google",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:jest/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/typescript",
"plugin:jsx-a11y/recommended",
"prettier",
"prettier/react",
"prettier/@typescript-eslint"
"prettier"
],
"plugins": ["import", "jest", "jsx-a11y", "react-hooks", "prettier"],
"plugins": ["import", "jest", "jsx-a11y", "react-hooks"],
"env": {
"es6": true,
"node": true,
Expand All @@ -32,9 +29,6 @@
}
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
Expand All @@ -44,22 +38,6 @@
"parser": "@typescript-eslint/parser",
"rules": {
"curly": ["error", "all"],
"prettier/prettier": [
2,
{
"useTabs": false,
"printWidth": 160,
"tabWidth": 2,
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": true,
"trailingComma": "es5",
"semi": true,
"parser": "typescript",
"importOrder": ["^@verdaccio/(.*)$", "^[./]"],
"importOrderSeparation": true
}
],
"react/prop-types": 0,
"jest/no-export": 0,
"jest/no-test-callback": 0,
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -34,6 +34,8 @@ jobs:
run: npm i -g pnpm
- name: Install
run: pnpm recursive install
- name: Format
run: pnpm format --check
- name: Lint
run: pnpm lint
- name: Clean
Expand Down
14 changes: 14 additions & 0 deletions .prettierignore
@@ -0,0 +1,14 @@
.cache/
**/corrupted-package/package.json
**/corrupted.json
**/invalid.json
**/verdaccio-corrupted.db.json
**/wrong.package.json
**/invalid.js
/website/.cache/
/website/crowdin/
/website/public/
/website/src/dictionaries/
CHANGELOG.md
CONTRIBUTORS.md
node_modules/
7 changes: 3 additions & 4 deletions website/.prettierrc.json → .prettierrc.json
@@ -1,12 +1,11 @@
{
"endOfLine": "auto",
"endOfLine": "lf",
"useTabs": false,
"printWidth": 180,
"printWidth": 160,
"tabWidth": 2,
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": true,
"trailingComma": "es5",
"semi": true,
"parser": "typescript"
"semi": true
}
2 changes: 0 additions & 2 deletions CONTRIBUTORS.md
@@ -1,5 +1,4 @@
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
Expand Down Expand Up @@ -37,5 +36,4 @@
</table>

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
31 changes: 20 additions & 11 deletions package.json
Expand Up @@ -38,8 +38,8 @@
"@babel/preset-typescript": "7.10.4",
"@babel/register": "7.10.5",
"@babel/runtime": "7.10.5",
"@changesets/changelog-github": "^0.1.1",
"@changesets/cli": "^2.10.1",
"@changesets/changelog-github": "0.1.1",
"@changesets/cli": "2.9.2",
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.2.0",
"@octokit/rest": "17.0.0",
Expand All @@ -54,8 +54,8 @@
"@types/request": "2.48.3",
"@types/semver": "7.2.0",
"@types/supertest": "2.0.9",
"@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1",
"@typescript-eslint/eslint-plugin": "3.9.1",
"@typescript-eslint/parser": "3.9.1",
"@verdaccio/types": "workspace:*",
"@verdaccio/ui-theme": "latest",
"babel-core": "7.0.0-bridge.0",
Expand All @@ -72,10 +72,9 @@
"eslint-plugin-babel": "5.3.0",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jest": "23.8.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"eslint-plugin-jsx-a11y": "6.3.1",
"eslint-plugin-react": "7.20.5",
"eslint-plugin-react-hooks": "4.0.8",
"eslint-plugin-simple-import-sort": "5.0.2",
"eslint-plugin-verdaccio": "8.4.2",
"fs-extra": "8.1.0",
Expand All @@ -88,13 +87,13 @@
"kleur": "3.0.3",
"lint-staged": "8.2.1",
"nock": "12.0.3",
"npm-run-all": "^4.1.5",
"npm-run-all": "4.1.5",
"prettier": "2.0.5",
"rimraf": "3.0.2",
"selfsigned": "1.10.7",
"standard-version": "8.0.0",
"supertest": "4.0.2",
"typescript": "4.0.2",
"typescript": ">=3.3.1 <3.10.0",
"verdaccio": "latest",
"verdaccio-audit": "latest",
"verdaccio-auth-memory": "latest",
Expand All @@ -107,7 +106,8 @@
"clean": "pnpm recursive run clean",
"build": "pnpm recursive run build",
"docker": "docker build -t verdaccio/verdaccio:local . --no-cache",
"lint": "eslint . --ext .js,.ts,.tsx,.jsx",
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,yml,yaml,md}\"",
"lint": "eslint \"**/*.{js,jsx,ts,tsx}\"",
"test": "pnpm recursive test",
"test:e2e:cli": "cross-env NODE_ENV=test jest --config ./test/e2e-cli/jest.config.e2e.cli.js --passWithNoTests",
"website:lint": "cd website && yarn lint",
Expand All @@ -124,5 +124,14 @@
"extends": [
"@commitlint/config-conventional"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,ts,tsx,json,yml,yaml,md}": "prettier --write",
"*.{js,jsx,ts,tsx}": "eslint --cache --fix"
}
}

0 comments on commit 46dccda

Please sign in to comment.