mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Integrate prettier into eslint
This commit is contained in:
25
.eslintignore
Normal file
25
.eslintignore
Normal file
@@ -0,0 +1,25 @@
|
||||
*/node_modules/*
|
||||
*/build/*
|
||||
*/coverage/*
|
||||
|
||||
*/public/*
|
||||
*/views/*
|
||||
|
||||
*fonts*
|
||||
*logos*
|
||||
|
||||
.*
|
||||
*.png
|
||||
*.sh
|
||||
*.txt
|
||||
*.snap
|
||||
*.enc
|
||||
Dockerfile
|
||||
CHANGELOG
|
||||
LICENSE
|
||||
|
||||
marketing/*/*
|
||||
licenses/*
|
||||
certifications/*
|
||||
api-docs/public/assets/*
|
||||
server-monitor/out/scripts/prettify/*
|
||||
98
.eslintrc.json
Normal file
98
.eslintrc.json
Normal file
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 8,
|
||||
"ecmaFeatures": {
|
||||
"experimentalObjectRestSpread": true,
|
||||
"jsx": true,
|
||||
"spread": true
|
||||
},
|
||||
"sourceType": "module"
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"jquery": true,
|
||||
"es6": true,
|
||||
"jest": true
|
||||
},
|
||||
"plugins": ["react", "jsx-a11y"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"parser": "babel-eslint",
|
||||
"rules": {
|
||||
"no-fallthrough": "error",
|
||||
"no-unreachable": "error",
|
||||
"no-cond-assign": "error",
|
||||
"valid-typeof": "error",
|
||||
"no-func-assign": "error",
|
||||
"no-extra-semi": "error",
|
||||
"linebreak-style": ["error", "unix"],
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
"varsIgnorePattern": "[iI]gnored",
|
||||
"vars": "all",
|
||||
"args": "after-used",
|
||||
"ignoreRestSiblings": true,
|
||||
"argsIgnorePattern": "[iI]gnored"
|
||||
}
|
||||
],
|
||||
"no-console": "error",
|
||||
"no-undef": "error",
|
||||
"no-empty": "error",
|
||||
"no-case-declarations": "error",
|
||||
"no-mixed-spaces-and-tabs": "error",
|
||||
"no-useless-escape": "error",
|
||||
"react/jsx-no-undef": "error",
|
||||
"react/jsx-no-bind": [
|
||||
"error",
|
||||
{
|
||||
"allowArrowFunctions": true,
|
||||
"allowBind": false,
|
||||
"ignoreRefs": false
|
||||
}
|
||||
],
|
||||
"react/no-children-prop": "error",
|
||||
"react/no-deprecated": "error",
|
||||
"react/boolean-prop-naming": "error",
|
||||
"react/no-is-mounted": "error",
|
||||
"react/no-find-dom-node": "error",
|
||||
"react/no-did-update-set-state": "error",
|
||||
"react/no-unknown-property": "error",
|
||||
"react/no-unused-prop-types": "error",
|
||||
"react/jsx-no-duplicate-props": "error",
|
||||
"react/no-unused-state": "error",
|
||||
"react/jsx-uses-vars": "error",
|
||||
"react/prop-types": "error",
|
||||
"react/react-in-jsx-scope": "error",
|
||||
"react/no-string-refs": "error",
|
||||
"jsx-a11y/href-no-hash": [0],
|
||||
"react/no-unescaped-entities": "error",
|
||||
"react/display-name": [
|
||||
"error",
|
||||
{
|
||||
"ignoreTranspilerName": true
|
||||
}
|
||||
],
|
||||
"react/jsx-pascal-case": "error",
|
||||
"array-callback-return": "error",
|
||||
"no-loop-func": "error",
|
||||
"jsx-a11y/anchor-is-valid": "error",
|
||||
"prefer-const": [
|
||||
"error",
|
||||
{
|
||||
"destructuring": "any",
|
||||
"ignoreReadBeforeAssign": false
|
||||
}
|
||||
],
|
||||
"no-var": "error"
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "16.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,4 +30,26 @@ cleanup.sh
|
||||
*.local.sh
|
||||
*.local.yaml
|
||||
|
||||
nohup.out*
|
||||
nohup.out*
|
||||
|
||||
*/public/*
|
||||
*/views/*
|
||||
|
||||
*fonts*
|
||||
*logos*
|
||||
|
||||
.*
|
||||
*.png
|
||||
*.sh
|
||||
*.txt
|
||||
*.snap
|
||||
*.enc
|
||||
Dockerfile
|
||||
CHANGELOG
|
||||
LICENSE
|
||||
|
||||
marketing/*/*
|
||||
licenses/*
|
||||
certifications/*
|
||||
api-docs/public/assets/*
|
||||
server-monitor/out/scripts/prettify/*
|
||||
122
package.json
122
package.json
@@ -1,80 +1,48 @@
|
||||
{
|
||||
"name": "app",
|
||||
"version": "1.0.0",
|
||||
"description": "One Complete DevOps and IT Ops platform.",
|
||||
"main": "index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
||||
"eslint-plugin-react": "^7.17.0",
|
||||
"husky": "^4.2.3",
|
||||
"lint-staged": "^9.5.0",
|
||||
"prettier": "^1.19.1"
|
||||
},
|
||||
"scripts": {
|
||||
"delete-all-local-branches": "git branch | grep -v 'master' | xargs git branch -D"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://gitlab.com/fyipe-project/app.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://gitlab.com/fyipe-project/app/issues"
|
||||
},
|
||||
"homepage": "https://gitlab.com/fyipe-project/app#readme",
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
"name": "app",
|
||||
"version": "1.0.0",
|
||||
"description": "One Complete DevOps and IT Ops platform.",
|
||||
"main": "index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.1.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-prettier": "^6.10.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.3",
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"eslint-plugin-react": "^7.17.0",
|
||||
"husky": "^4.2.3",
|
||||
"lint-staged": "^9.5.0",
|
||||
"prettier": "^1.19.1"
|
||||
},
|
||||
"scripts": {
|
||||
"delete-all-local-branches": "git branch | grep -v 'master' | xargs git branch -D",
|
||||
"lint": "prettier '**/*' --write --config .prettierrc.json && eslint '**/*.js' -c .eslintrc.json --ignore-path .eslintignore --fix"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://gitlab.com/fyipe-project/app.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://gitlab.com/fyipe-project/app/issues"
|
||||
},
|
||||
"homepage": "https://gitlab.com/fyipe-project/app#readme",
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"./**/*.{json,yml,yaml,md}": [
|
||||
"prettier --write --config .prettierrc.json",
|
||||
"git add"
|
||||
],
|
||||
"./**/*.{js}": [
|
||||
"eslint -c .eslintrc.json --ignore-path .eslintignore --fix",
|
||||
"git add"
|
||||
]
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"./**/*.{js,jsx}": [
|
||||
"prettier --config .prettierrc.json --write",
|
||||
"git add"
|
||||
],
|
||||
"./dashboard/**/*.{js,jsx}": [
|
||||
"eslint dashboard/src -c dashboard/.eslintrc.json --ignore-path dashboard/.eslintignore",
|
||||
"git add"
|
||||
],
|
||||
"./backend/**/*.js": [
|
||||
"eslint backend/backend -c backend/.eslintrc.json --ignore-path backend/.eslintignore",
|
||||
"git add"
|
||||
],
|
||||
"./accounts/**/*.{js,jsx}": [
|
||||
"eslint accounts/src -c accounts/.eslintrc.json --ignore-path accounts/.eslintignore",
|
||||
"git add"
|
||||
],
|
||||
"./admin-dashboard/**/*.{js,jsx}": [
|
||||
"eslint admin-dashboard/src -c admin-dashboard/.eslintrc.json --ignore-path admin-dashboard/.eslintignore",
|
||||
"git add"
|
||||
],
|
||||
"./home/**/*.{js}": [
|
||||
"eslint home -c home/.eslintrc.json --ignore-path home/.eslintignore",
|
||||
"git add"
|
||||
],
|
||||
"./probe/**/*.{js}": [
|
||||
"eslint probe -c probe/.eslintrc.json --ignore-path probe/.eslintignore",
|
||||
"git add"
|
||||
],
|
||||
"./status-page/**/*.{js,jsx}": [
|
||||
"eslint status-page/src -c status-page/.eslintrc.json --ignore-path status-page/.eslintignore",
|
||||
"git add"
|
||||
],
|
||||
"./zapier/**/*.{js,jsx}": [
|
||||
"eslint zapier -c zapier/.eslintrc.json --ignore-path zapier/.eslintignore",
|
||||
"git add"
|
||||
],
|
||||
"./server-monitor/**/*.{js,jsx}": [
|
||||
"eslint server-monitor/lib -c server-monitor/.eslintrc.json --ignore-path server-monitor/.eslintignore",
|
||||
"git add"
|
||||
],
|
||||
"./http-test-server/**/*.{js,jsx}": [
|
||||
"eslint -c http-test-server/.eslintrc.json --ignore-path http-test-server/.eslintignore",
|
||||
"git add"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user