feat(tooling): add eslint-config to tooling pkgs

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-21 22:47:55 +01:00
committed by Braks
parent 5c0fb912fc
commit 45cbdbfd27
34 changed files with 764 additions and 898 deletions

View File

@@ -1,15 +0,0 @@
const baseRules = {
'vue/no-setup-props-destructure': 0,
'no-console': 0,
'chai-friendly/no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
'antfu/if-newline': 0,
'antfu/generic-spacing': 0,
}
module.exports = {
extends: ['@antfu', 'plugin:prettier/recommended'],
plugins: ['chai-friendly', 'prettier'],
rules: baseRules,
}

View File

@@ -1,8 +0,0 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": false,
"quoteProps": "consistent",
"bracketSpacing": true,
"printWidth": 130
}

3
docs/.eslintrc.js Normal file
View File

@@ -0,0 +1,3 @@
module.exports = {
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -6,7 +6,7 @@
"dev": "pnpm run typedoc:md && vitepress dev src",
"docs": "pnpm run typedoc:md && vitepress build src",
"serve": "vitepress serve src",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix .",
"typedoc:md": "typedoc --options ./typedoc.md.json",
"typedocs": "typedoc --options ./typedoc.json"
},
@@ -33,6 +33,7 @@
"@iconify/json": "^2.1.95",
"@types/canvas-confetti": "^1.4.3",
"@types/node": "^18.11.18",
"@vue-flow/eslint-config": "workspace:*",
"@windicss/plugin-scrollbar": "^1.2.3",
"dotenv": "^16.0.3",
"ohmyfetch": "^0.4.21",

View File

@@ -0,0 +1,3 @@
module.exports = {
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -12,6 +12,7 @@
"@vue-flow/minimap": "workspace:*"
},
"devDependencies": {
"@vue-flow/eslint-config": "workspace:*",
"nuxt": "^3.2.2"
}
}

View File

@@ -0,0 +1,3 @@
module.exports = {
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -18,6 +18,7 @@
},
"devDependencies": {
"@quasar/app-vite": "^1.0.5",
"@vue-flow/eslint-config": "workspace:*",
"@vitejs/plugin-vue": "^2.3.4",
"@types/node": "^18.8.3",
"autoprefixer": "^10.4.12"

View File

@@ -1,8 +1,3 @@
module.exports = {
rules: {
'no-use-before-define': 0,
'no-console': 0,
'no-unused-vars': 1,
},
extends: ['../../.eslintrc.js'],
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "vite",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore ."
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix ."
},
"dependencies": {
"vueflow": "workspace:*",
@@ -17,6 +17,7 @@
},
"devDependencies": {
"@types/dagre": "^0.7.48",
"@vue-flow/eslint-config": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"dagre": "^0.8.5",
"unplugin-auto-import": "^0.14.4",

View File

@@ -18,11 +18,6 @@
"@antfu/eslint-config": "^0.35.2",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.0",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-chai-friendly": "^0.7.2",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.4",
"shx": "^0.3.4",
"turbo": "^1.8.1",
"typescript": "^4.9.5"

View File

@@ -1,8 +1,3 @@
module.exports = {
rules: {
'no-use-before-define': 0,
'vue/no-setup-props-destructure': 0,
},
extends: ['../../.eslintrc.js'],
ignorePatterns: ['!**/*'],
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -24,7 +24,7 @@
"scripts": {
"build": "vite build",
"types": "vue-tsc --declaration --emitDeclarationOnly && pnpm lint:dist",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../.gitignore .",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix .",
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
"test": "exit 0"
},
@@ -35,6 +35,7 @@
"dependencies": {},
"devDependencies": {
"@vue-flow/core": "workspace:*",
"@vue-flow/eslint-config": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"unplugin-auto-import": "^0.14.4",
"vite": "^4.1.3",

View File

@@ -1,8 +1,3 @@
module.exports = {
rules: {
'no-use-before-define': 0,
'vue/no-setup-props-destructure': 0,
},
extends: ['../../.eslintrc.js'],
ignorePatterns: ['!**/*'],
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -24,7 +24,7 @@
"scripts": {
"build": "vite build",
"types": "vue-tsc --declaration --emitDeclarationOnly && pnpm lint:dist",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../.gitignore .",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix .",
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
"test": "exit 0"
},
@@ -35,6 +35,7 @@
"dependencies": {},
"devDependencies": {
"@vue-flow/core": "workspace:*",
"@vue-flow/eslint-config": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"unplugin-auto-import": "^0.14.4",
"vite": "^4.1.3",

View File

@@ -1,10 +1,3 @@
module.exports = {
rules: {
'no-console': 'error',
'no-use-before-define': 0,
'vue/no-setup-props-destructure': 0,
'react/prop-types': 0,
},
extends: ['../../.eslintrc.js'],
ignorePatterns: ['!**/*'],
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -29,7 +29,7 @@
"types": "pnpm prepare && vue-tsc --declaration --emitDeclarationOnly && tsc -p ./tsconfig.build.json && shx rm -rf tmp && pnpm lint:dist && pnpm run patch",
"patch": "node patch/slots.js",
"theme": "postcss src/style.css -o dist/style.css && postcss src/theme-default.css -o dist/theme-default.css",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../.gitignore .",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix .",
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
"prepublishOnly": "shx cp ../../README.md .",
"postpublish": "shx rm README.md && git commit -a -m \"chore: bump version\"",
@@ -47,6 +47,7 @@
"devDependencies": {
"@rollup/plugin-replace": "^5.0.2",
"@types/d3": "^7.4.0",
"@vue-flow/eslint-config": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"autoprefixer": "^10.4.13",
"postcss": "^8.4.21",

View File

@@ -58,6 +58,5 @@ const patchSlots = async () => {
}
patchSlots()
// eslint-disable-next-line no-console
.then(() => console.log('slots patched'))
.catch(console.error)

View File

@@ -1,8 +1,3 @@
module.exports = {
rules: {
'no-use-before-define': 0,
'vue/no-setup-props-destructure': 0,
},
extends: ['../../.eslintrc.js'],
ignorePatterns: ['!**/*'],
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -24,7 +24,7 @@
"scripts": {
"build": "vite build",
"types": "vue-tsc --declaration --emitDeclarationOnly && pnpm lint:dist",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../.gitignore .",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix .",
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
"test": "exit 0"
},
@@ -40,6 +40,7 @@
"@types/d3-selection": "^3.0.3",
"@types/d3-zoom": "^3.0.1",
"@vue-flow/core": "workspace:*",
"@vue-flow/eslint-config": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"unplugin-auto-import": "^0.14.4",
"vite": "^4.1.3",

View File

@@ -1,8 +1,3 @@
module.exports = {
rules: {
'no-use-before-define': 0,
'vue/no-setup-props-destructure': 0,
},
extends: ['../../.eslintrc.js'],
ignorePatterns: ['!**/*'],
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -24,7 +24,7 @@
"scripts": {
"build": "vite build",
"types": "vue-tsc --declaration --emitDeclarationOnly && pnpm lint:dist",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../.gitignore .",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix .",
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
"test": "exit 0"
},
@@ -40,6 +40,7 @@
"@types/d3-drag": "^3.0.1",
"@types/d3-selection": "^3.0.3",
"@vue-flow/core": "workspace:*",
"@vue-flow/eslint-config": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"unplugin-auto-import": "^0.14.4",
"vite": "^4.1.3",

View File

@@ -1,8 +1,3 @@
module.exports = {
rules: {
'no-use-before-define': 0,
'vue/no-setup-props-destructure': 0,
},
extends: ['../../.eslintrc.js'],
ignorePatterns: ['!**/*'],
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -24,7 +24,7 @@
"scripts": {
"build": "vite build",
"types": "vue-tsc --declaration --emitDeclarationOnly && pnpm lint:dist",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../.gitignore .",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix .",
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
"test": "exit 0"
},
@@ -35,6 +35,7 @@
"dependencies": {},
"devDependencies": {
"@vue-flow/core": "workspace:*",
"@vue-flow/eslint-config": "workspace:*",
"@vitejs/plugin-vue": "^4.0.0",
"unplugin-auto-import": "^0.14.4",
"vite": "^4.1.3",

View File

@@ -1,8 +1,3 @@
module.exports = {
rules: {
'no-use-before-define': 0,
'vue/no-setup-props-destructure': 0,
},
extends: ['../../.eslintrc.js'],
ignorePatterns: ['!**/*'],
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -1,99 +0,0 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# Nuxt generate
dist
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless
.webpack
# IDE / Editor
.idea
# Service worker
sw.*
# macOS
.DS_Store
# Vim swap files
*.swp
# Db-Data
hasura/db_data/
# Codegen types
types/types.ts
build

View File

@@ -1,8 +0,0 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": false,
"quoteProps": "consistent",
"bracketSpacing": true,
"printWidth": 130
}

View File

@@ -24,7 +24,7 @@
"types": "pnpm prepare && vue-tsc --declaration --emitDeclarationOnly && shx rm -rf tmp",
"postbuild": "shx rm -rf tmp",
"test": "exit 0;",
"lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path .gitignore .",
"lint:js": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix .",
"lint": "pnpm lint:js"
},
"dependencies": {
@@ -33,6 +33,7 @@
},
"devDependencies": {
"@vue-flow/core": "workspace:*",
"@vue-flow/eslint-config": "workspace:*",
"@types/pathfinding": "^0.0.6",
"@vitejs/plugin-vue": "^4.0.0",
"ts-patch": "^2.1.0",

View File

@@ -1,9 +1,3 @@
module.exports = {
rules: {
'no-use-before-define': 0,
'vue/no-setup-props-destructure': 0,
'react/prop-types': 0,
},
extends: ['../../.eslintrc.js'],
ignorePatterns: ['!**/*'],
extends: ['@vue-flow/eslint-config'],
}

View File

@@ -25,7 +25,7 @@
"build": "vite build",
"types": "tsc && shx rm -rf tmp && pnpm lint:dist",
"theme": "postcss src/style.css -o dist/style.css && postcss src/theme-default.css -o dist/theme-default.css",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix --ignore-path ../../.gitignore .",
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" --fix .",
"lint:dist": "eslint --ext \".ts,.tsx\" -c .eslintrc.js --fix ./dist",
"prepublishOnly": "shx cp ../../README.md .",
"postpublish": "shx rm README.md && git commit -a -m \"chore: bump version\"",
@@ -38,6 +38,7 @@
"@vue-flow/background": "workspace:*",
"@vue-flow/controls": "workspace:*",
"@vue-flow/core": "workspace:*",
"@vue-flow/eslint-config": "workspace:*",
"@vue-flow/minimap": "workspace:*"
},
"devDependencies": {

1380
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
packages:
- packages/*
- tooling/*
- examples/*
- e2e
- tests
- docs

View File

@@ -0,0 +1,22 @@
module.exports = {
extends: ['@antfu', 'plugin:prettier/recommended'],
plugins: ['prettier'],
rules: {
'vue/no-setup-props-destructure': 0,
'no-console': 0,
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'all',
semi: false,
quoteProps: 'consistent',
bracketSpacing: true,
printWidth: 130,
},
],
'antfu/if-newline': 0,
'antfu/generic-spacing': 0,
},
}

View File

@@ -0,0 +1,14 @@
{
"name": "@vue-flow/eslint-config",
"version": "0.0.0",
"private": true,
"license": "MIT",
"main": "index.js",
"devDependencies": {
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-config-turbo": "0.0.8",
"prettier": "^2.8.4"
}
}