dev: use eslint prettier plugin (#132)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-03-21 08:35:20 +01:00 committed by GitHub
parent 4d58d49bfe
commit 3292b1ba35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

View file

@ -7,7 +7,8 @@
"extends": [ "extends": [
"eslint:recommended", "eslint:recommended",
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
"plugin:jest/recommended" "plugin:jest/recommended",
"plugin:prettier/recommended"
], ],
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "parserOptions": {
@ -16,6 +17,7 @@
}, },
"plugins": [ "plugins": [
"@typescript-eslint", "@typescript-eslint",
"jest" "jest",
"prettier"
] ]
} }

View file

@ -4,12 +4,8 @@
"main": "lib/main.js", "main": "lib/main.js",
"scripts": { "scripts": {
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt", "build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
"lint-check": "eslint src/**/*.ts __tests__/**/*.ts", "lint": "eslint src/**/*.ts __tests__/**/*.ts",
"lint-fix": "eslint --fix src/**/*.ts __tests__/**/*.ts", "format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
"prettier-check": "prettier --check **/*.ts",
"prettier-fix": "prettier --write **/*.ts",
"lint": "yarn run lint-check && yarn run prettier-check",
"format": "yarn run lint-fix && yarn run prettier-fix",
"test": "jest --coverage", "test": "jest --coverage",
"all": "yarn run build && yarn run format && yarn test" "all": "yarn run build && yarn run format && yarn test"
}, },
@ -37,6 +33,7 @@
"@typescript-eslint/parser": "^5.14.0", "@typescript-eslint/parser": "^5.14.0",
"@vercel/ncc": "^0.33.3", "@vercel/ncc": "^0.33.3",
"eslint": "^8.11.0", "eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.1", "eslint-plugin-jest": "^26.1.1",
"eslint-plugin-prettier": "^4.0.0", "eslint-plugin-prettier": "^4.0.0",
"jest": "^27.2.5", "jest": "^27.2.5",

View file

@ -1557,6 +1557,11 @@ escodegen@^2.0.0:
optionalDependencies: optionalDependencies:
source-map "~0.6.1" source-map "~0.6.1"
eslint-config-prettier@^8.5.0:
version "8.5.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz#5a81680ec934beca02c7b1a61cf8ca34b66feab1"
integrity sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==
eslint-plugin-jest@^26.1.1: eslint-plugin-jest@^26.1.1:
version "26.1.1" version "26.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.1.1.tgz#7176dd745ef8bca3070263f62cdf112f2dfc9aa1" resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.1.1.tgz#7176dd745ef8bca3070263f62cdf112f2dfc9aa1"