aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-07-25 20:54:38 +0200
committerHampusM <hampus@hampusmat.com>2021-07-25 20:54:38 +0200
commite8392e65591b99f52c89cbec4554c87b19bde335 (patch)
tree18d5d7cddcd7f81e821dd2c5f6b3e0182b0153a9
parenta32365a7fea97fbf2a7b906ea77415ab744e7b43 (diff)
Organized Eslint stuff
-rw-r--r--package.json7
-rw-r--r--packages/client/.eslintrc.json41
-rw-r--r--packages/client/package.json7
-rw-r--r--packages/eslint-config-base/.eslintrc.json10
-rw-r--r--packages/eslint-config-base/index.js (renamed from .eslintrc.json)90
-rw-r--r--packages/eslint-config-base/package.json8
-rw-r--r--packages/server/.eslintrc.json17
-rw-r--r--packages/server/package.json6
-rw-r--r--test/.eslintrc.json17
-rw-r--r--yarn.lock11
10 files changed, 141 insertions, 73 deletions
diff --git a/package.json b/package.json
index 0539fa6..32ff023 100644
--- a/package.json
+++ b/package.json
@@ -17,18 +17,11 @@
"devDependencies": {
"@types/fs-extra": "^9.0.12",
"@types/jest": "^26.0.23",
- "client": "^1.0.0",
"concurrently": "^6.2.0",
"dotenv": "^10.0.0",
"eslint": "^7.31.0",
- "eslint-config-standard": "^16.0.3",
- "eslint-plugin-import": "^2.23.4",
- "eslint-plugin-node": "^11.1.0",
- "eslint-plugin-promise": "^5.1.0",
- "eslint-plugin-vue": "^7.14.0",
"fs-extra": "^10.0.0",
"jest": "^27.0.6",
- "server": "^1.0.0",
"ts-jest": "^27.0.3",
"typescript": "^4.3.5"
}
diff --git a/packages/client/.eslintrc.json b/packages/client/.eslintrc.json
new file mode 100644
index 0000000..d60df09
--- /dev/null
+++ b/packages/client/.eslintrc.json
@@ -0,0 +1,41 @@
+{
+ "env": {
+ "node": true
+ },
+ "parser": "vue-eslint-parser",
+ "parserOptions": {
+ "parser": "@typescript-eslint/parser"
+ },
+ "extends": [
+ "plugin:vue/vue3-strongly-recommended",
+ "@vue/standard",
+ "@vue/typescript",
+ "base"
+ ],
+ "overrides": [
+ {
+ "files": ["*.ts"],
+ "extends": [
+ "plugin:@typescript-eslint/recommended"
+ ]
+ }
+ ],
+ "rules": {
+ "vue/max-attributes-per-line": [ "warn", {
+ "singleline": {
+ "max": 2,
+ "allowFirstLine": true
+ },
+ "multiline": {
+ "max": 2,
+ "allowFirstLine": false
+ }
+ } ],
+ "vue/html-closing-bracket-newline": [ "error", {
+ "singleline": "never",
+ "multiline": "never"
+ } ],
+ "vue/html-indent": [ "error", "tab" ],
+ "typescript-eslint/no-var-requires": "off"
+ }
+} \ No newline at end of file
diff --git a/packages/client/package.json b/packages/client/package.json
index 65496d4..a82dafd 100644
--- a/packages/client/package.json
+++ b/packages/client/package.json
@@ -32,10 +32,17 @@
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-standard": "^6.0.0",
"@vue/eslint-config-typescript": "^7.0.0",
+ "eslint": "^7.31.0",
+ "eslint-config-base": "^1.0.0",
+ "eslint-plugin-import": "^2.23.4",
+ "eslint-plugin-node": "^11.1.0",
+ "eslint-plugin-promise": "^4.2.1",
+ "eslint-plugin-vue": "^7.14.0",
"sass": "^1.26.5",
"sass-loader": "^12.1.0",
"shared_types": "^1.0.0",
"typescript": "^4.3.5",
+ "vue-eslint-parser": "^7.9.0",
"webpack": "^5.46.0"
},
"license": "MIT"
diff --git a/packages/eslint-config-base/.eslintrc.json b/packages/eslint-config-base/.eslintrc.json
new file mode 100644
index 0000000..d79f15b
--- /dev/null
+++ b/packages/eslint-config-base/.eslintrc.json
@@ -0,0 +1,10 @@
+{
+ "env": {
+ "es2021": true,
+ "node": true
+ },
+ "parserOptions": {
+ "ecmaVersion": 12
+ },
+ "extends": "./index.js"
+}
diff --git a/.eslintrc.json b/packages/eslint-config-base/index.js
index ce3a490..bcd5f24 100644
--- a/.eslintrc.json
+++ b/packages/eslint-config-base/index.js
@@ -1,26 +1,5 @@
-{
- "root": true,
- "env": {
- "commonjs": true,
- "es2021": true,
- "node": true
- },
- "extends": [
- "standard",
- "plugin:@typescript-eslint/recommended",
- "plugin:vue/vue3-strongly-recommended",
- "@vue/standard",
- "@vue/typescript"
- ],
- "parser": "@typescript-eslint/parser",
- "parserOptions": {
- "ecmaVersion": 12
- },
- "plugins": [ "@typescript-eslint" ],
- "ignorePatterns": [
- "/node_modules"
- ],
- "rules": {
+module.exports = {
+ rules: {
"no-console": "off",
"no-debugger": "off",
"array-bracket-spacing": [
@@ -37,12 +16,12 @@
"arrow-spacing": [
"error",
{
- "after": true,
- "before": true
+ after: true,
+ before: true
}
],
- "brace-style": [ "error", "stroustrup", { "allowSingleLine": false } ],
- "camelcase": "off",
+ "brace-style": [ "error", "stroustrup", { allowSingleLine: false } ],
+ camelcase: "off",
"capitalized-comments": [
"error",
"always"
@@ -50,8 +29,8 @@
"comma-spacing": [
"error",
{
- "after": true,
- "before": false
+ after: true,
+ before: false
}
],
"comma-style": [
@@ -63,13 +42,13 @@
"error",
"never"
],
- "curly": [ "error", "all" ],
+ curly: [ "error", "all" ],
"dot-notation": "off",
"eol-last": [
"error",
"never"
],
- "eqeqeq": "error",
+ eqeqeq: "error",
"func-names": "off",
"func-style": [ "error", "declaration" ],
"id-length": "off",
@@ -77,22 +56,22 @@
"error",
"beside"
],
- "indent": [ "warn", "tab" ],
+ indent: [ "warn", "tab" ],
"keyword-spacing": [ "error", {
- "before": false,
- "overrides": {
- "from": { "before": true },
- "for": { "after": false },
- "if": { "after": false },
- "throw": { "after": false },
- "while": { "after": false }
+ before: false,
+ overrides: {
+ from: { before: true },
+ for: { after: false },
+ if: { after: false },
+ throw: { after: false },
+ while: { after: false }
}
} ],
"linebreak-style": [
"error",
"unix"
],
- "line-comment-position": ["error", { "position": "above" }],
+ "line-comment-position": [ "error", { position: "above" } ],
"max-len": "off",
"max-lines": [ "error", 600 ],
"max-params": [ "error", 6 ],
@@ -103,14 +82,14 @@
"no-else-return": [
"error",
{
- "allowElseIf": true
+ allowElseIf: true
}
],
"no-extra-parens": "off",
"no-magic-numbers": "off",
"no-tabs": "off",
"no-ternary": "off",
- "no-underscore-dangle": [ "error", { "allowAfterThis": true } ],
+ "no-underscore-dangle": [ "error", { allowAfterThis: true } ],
"no-var": "error",
"object-curly-spacing": [
"error",
@@ -124,8 +103,8 @@
"prefer-destructuring": "off",
"prefer-template": "off",
"quote-props": [ "error", "as-needed" ],
- "quotes": [ "error", "double" ],
- "semi": [ "error", "always" ],
+ quotes: [ "error", "double" ],
+ semi: [ "error", "always" ],
"semi-style": [
"error",
"last"
@@ -140,7 +119,7 @@
"error",
"always"
],
- "strict": [
+ strict: [
"error",
"never"
],
@@ -152,24 +131,9 @@
"error",
"never"
],
- "yoda": [
+ yoda: [
"error",
"never"
- ],
- "vue/max-attributes-per-line": [ "warn", {
- "singleline": {
- "max": 2,
- "allowFirstLine": true
- },
- "multiline": {
- "max": 2,
- "allowFirstLine": false
- }
- } ],
- "vue/html-closing-bracket-newline": [ "error", {
- "singleline": "never",
- "multiline": "never"
- } ],
- "vue/html-indent": [ "error", "tab" ]
+ ]
}
-} \ No newline at end of file
+}; \ No newline at end of file
diff --git a/packages/eslint-config-base/package.json b/packages/eslint-config-base/package.json
new file mode 100644
index 0000000..51c3fcc
--- /dev/null
+++ b/packages/eslint-config-base/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "eslint-config-base",
+ "version": "1.0.0",
+ "main": "index.js",
+ "author": "HampusMat",
+ "license": "MIT",
+ "private": true
+}
diff --git a/packages/server/.eslintrc.json b/packages/server/.eslintrc.json
new file mode 100644
index 0000000..6d17384
--- /dev/null
+++ b/packages/server/.eslintrc.json
@@ -0,0 +1,17 @@
+{
+ "env": {
+ "commonjs": true,
+ "es2021": true,
+ "node": true
+ },
+ "extends": [
+ "standard",
+ "plugin:@typescript-eslint/recommended",
+ "base"
+ ],
+ "parserOptions": {
+ "ecmaVersion": 12,
+ "parser": "@typescript-eslint/parser"
+ },
+ "plugins": [ "@typescript-eslint" ]
+} \ No newline at end of file
diff --git a/packages/server/package.json b/packages/server/package.json
index f5ff6e1..06ce863 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -24,6 +24,12 @@
"@types/whatwg-url": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
+ "eslint": "^7.31.0",
+ "eslint-config-base": " ^1.0.0",
+ "eslint-config-standard": "^16.0.3",
+ "eslint-plugin-import": "^2.23.4",
+ "eslint-plugin-node": "^11.1.0",
+ "eslint-plugin-promise": "^5.1.0",
"nodemon": "^2.0.12",
"shared_types": "^1.0.0",
"ts-node": "^10.1.0",
diff --git a/test/.eslintrc.json b/test/.eslintrc.json
new file mode 100644
index 0000000..6d17384
--- /dev/null
+++ b/test/.eslintrc.json
@@ -0,0 +1,17 @@
+{
+ "env": {
+ "commonjs": true,
+ "es2021": true,
+ "node": true
+ },
+ "extends": [
+ "standard",
+ "plugin:@typescript-eslint/recommended",
+ "base"
+ ],
+ "parserOptions": {
+ "ecmaVersion": 12,
+ "parser": "@typescript-eslint/parser"
+ },
+ "plugins": [ "@typescript-eslint" ]
+} \ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 660643c..10112be 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4508,6 +4508,11 @@ eslint-plugin-node@^11.1.0:
resolve "^1.10.1"
semver "^6.1.0"
+eslint-plugin-promise@^4.2.1:
+ version "4.3.1"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.3.1.tgz#61485df2a359e03149fdafc0a68b0e030ad2ac45"
+ integrity sha512-bY2sGqyptzFBDLh/GMbAxfdJC+b0f23ME63FOE4+Jao0oZ3E1LEwFtWJX/1pGMJLiTtrSSern2CRM/g+dfc0eQ==
+
eslint-plugin-promise@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz#fb2188fb734e4557993733b41aa1a688f46c6f24"
@@ -7838,9 +7843,9 @@ object-copy@^0.1.0:
kind-of "^3.0.3"
object-inspect@^1.10.3:
- version "1.10.3"
- resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369"
- integrity sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==
+ version "1.11.0"
+ resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1"
+ integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==
object-is@^1.0.1:
version "1.1.5"