-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update eslint and prettier configs
- Loading branch information
1 parent
cb7a0e2
commit 40c5e8d
Showing
5 changed files
with
547 additions
and
833 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,53 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
root: true, | ||
extends: '@myparcel/eslint-config/preset-typescript', | ||
parserOptions:{ | ||
project: path.resolve(__dirname, 'tsconfig.json'), | ||
}, | ||
rules: { | ||
'@typescript-eslint/require-await': 'off', | ||
'class-methods-use-this': 'off', | ||
'padding-line-between-statements': [ | ||
'error', | ||
{ blankLine: 'always', prev: '*', next: 'if' }, | ||
{ blankLine: 'always', prev: 'if', next: '*' }, | ||
{ blankLine: 'never', prev: 'const', next: 'const' }, | ||
{ blankLine: 'always', prev: 'const', next: 'multiline-const' }, | ||
{ blankLine: 'always', prev: 'multiline-const', next: 'multiline-const' }, | ||
], | ||
'space-before-blocks': ['error', 'always'], | ||
}, | ||
overrides: [ | ||
// Vue and related files | ||
{ | ||
extends: [ | ||
'@myparcel/eslint-config/preset-vue3-typescript', | ||
'plugin:vue/vue3-recommended', | ||
'@vue/eslint-config-typescript', | ||
], | ||
files: [ | ||
'!./src/.vuepress/**/*.spec.*', | ||
'!./src/.vuepress/*.js', | ||
'!./src/.vuepress/*.ts', | ||
'./src/.vuepress/**/*', | ||
], | ||
files: ['./**/*.vue'], | ||
extends: '@myparcel-eslint/eslint-config-prettier-typescript-vue', | ||
rules: { | ||
'vue/multi-word-component-names': 'off', | ||
'vue/no-unregistered-components': 'off', | ||
'@typescript-eslint/no-misused-promises': 'off', | ||
'vue/html-self-closing': 'off', | ||
'vue/no-bare-strings-in-template': 'off', | ||
'vue/no-undef-components': [ | ||
'error', | ||
{ | ||
ignorePatterns: [ | ||
'AutoLink', | ||
'Badge', | ||
'CodeGroup', | ||
'CodeGroupItem', | ||
'Content', | ||
'ExternalLinkIcon', | ||
'HomeLink', | ||
'NavbarSearch', | ||
'RouterLink', | ||
'RouterView', | ||
'Transition', | ||
'TransitionGroup', | ||
], | ||
ignorePatterns: ['^Pdk(?:\\w)+$'], | ||
}, | ||
], | ||
'vue/no-bare-strings-in-template': 'off', | ||
|
||
'@typescript-eslint/restrict-plus-operands': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['./**/*.ts', './**/*.tsx'], | ||
extends: '@myparcel-eslint/eslint-config-prettier-typescript', | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
|
||
// These rules are extremely slow | ||
'@typescript-eslint/no-misused-promises': 'off', | ||
'@typescript-eslint/promise-function-async': 'off', | ||
'class-methods-use-this': 'off', | ||
}, | ||
}, | ||
|
||
{ | ||
// Config files and test specs | ||
files: [ | ||
'./*.cjs', | ||
'./*.mjs', | ||
'./*.ts', | ||
'./src/.vuepress/**/*.spec.*', | ||
'./src/.vuepress/*.mjs', | ||
'./src/.vuepress/*.ts', | ||
], | ||
env: { | ||
node: true, | ||
files: ['./**/*.js', './**/*.mjs'], | ||
parserOptions: { | ||
sourceType: 'module', | ||
}, | ||
}, | ||
{ | ||
files: ['./**/*.js', './**/*.cjs', './**/*.mjs'], | ||
extends: [ | ||
'@myparcel-eslint/eslint-config-node', | ||
'@myparcel-eslint/eslint-config-esnext', | ||
'@myparcel-eslint/eslint-config-prettier', | ||
], | ||
}, | ||
{ | ||
files: ['./**/*.spec.*', './**/*.test.*', './**/__tests__/**', './**/*Test.*'], | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-magic-numbers': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'max-len': 'off', | ||
'max-lines-per-function': 'off', | ||
'no-magic-numbers': 'off', | ||
'vue/max-len': 'off', | ||
}, | ||
}, | ||
], | ||
}; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,23 +3,13 @@ | |
"version": "0.0.1", | ||
"private": true, | ||
"description": "MyParcel Developer Portal", | ||
"keywords": [ | ||
"myparcel" | ||
], | ||
"homepage": "https://developer.myparcel.nl", | ||
"bugs": { | ||
"url": "https://github.com/myparcelnl/developer/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/myparcelnl/developer.git" | ||
}, | ||
"repository": "github:myparcelnl/developer", | ||
"license": "MIT", | ||
"author": "Edie Lemoine <[email protected]>", | ||
"main": "index.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"build": "yarn optimize:svg -q && vuepress build src", | ||
"dev": "vuepress dev src", | ||
|
@@ -38,11 +28,12 @@ | |
}, | ||
"lint-staged": { | ||
"package.json": "npx sort-package-json", | ||
"src/**/*.{js,ts,vue}": "eslint --fix", | ||
"test/**/*.{js,ts,vue}": "eslint --fix", | ||
"src/**/*.{js,cjs,mjs,ts,vue}": "eslint --fix", | ||
"test/**/*.{js,cjs,mjs,ts,vue}": "eslint --fix", | ||
"src/**/*.svg": "svgo --multipass --final-newline", | ||
"**/*.{md,mdx,html}": "prettier --write" | ||
"**/*.{md,mdx,html,css,scss}": "prettier --write" | ||
}, | ||
"prettier": "@myparcel/prettier-config", | ||
"resolutions": { | ||
"vite": "^2" | ||
}, | ||
|
@@ -60,19 +51,23 @@ | |
}, | ||
"devDependencies": { | ||
"@edielemoine/google-docs-importer": "^1.0.2", | ||
"@myparcel/eslint-config": "^3.6.1", | ||
"@myparcel-eslint/eslint-config-esnext": "^1.2.3", | ||
"@myparcel-eslint/eslint-config-node": "^1.2.3", | ||
"@myparcel-eslint/eslint-config-prettier": "^1.2.3", | ||
"@myparcel-eslint/eslint-config-prettier-typescript": "^1.2.4", | ||
"@myparcel-eslint/eslint-config-prettier-typescript-vue": "^1.2.6", | ||
"@myparcel/sdk": "^2.10.1", | ||
"@tsconfig/node16": "^1.0.3", | ||
"@types/flat": "^5.0.2", | ||
"@types/lodash-es": "^4.17.6", | ||
"@types/mock-fs": "^4.13.1", | ||
"@vitejs/plugin-vue": "^2.3.3", | ||
"@vue/eslint-config-typescript": "^11.0.0", | ||
"@vue/test-utils": "^2.0.2", | ||
"autoprefixer": "^10.4.8", | ||
"concurrently": "^7.3.0", | ||
"cssnano": "^5.1.12", | ||
"dayjs": "^1.11.4", | ||
"eslint": "^8.40.0", | ||
"flat": "^5.0.2", | ||
"gray-matter": ">= 4.0", | ||
"happy-dom": "^6.0.4", | ||
|
@@ -86,7 +81,7 @@ | |
"mock-fs": "^5.1.2", | ||
"only-allow": "^1.1.1", | ||
"plop": "^3.1.1", | ||
"prettier": "^2.8.4", | ||
"prettier": "^2.8.8", | ||
"rollup-plugin-visualizer": "^5.7.1", | ||
"start-server-and-test": "^1.14.0", | ||
"svgo": "^2.8.0", | ||
|
Oops, something went wrong.