Skip to content

Commit

Permalink
fix eslint + prettier for whole repo
Browse files Browse the repository at this point in the history
  • Loading branch information
gdbroman committed Nov 16, 2022
1 parent 8625b8e commit 0932189
Show file tree
Hide file tree
Showing 18 changed files with 397 additions and 664 deletions.
12 changes: 0 additions & 12 deletions .editorconfig

This file was deleted.

89 changes: 89 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:react/recommended',
'standard-with-typescript',
'plugin:prettier/recommended',
],
overrides: [],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: [
'./app/tsconfig.json',
'./lib/room/tsconfig.json',
'./lib/conduit/tsconfig.json',
'./lib/multiplayer/tsconfig.json',
'./playground/ui/tsconfig.json',
'./tsconfig.eslint.json',
],
ecmaVersion: 'latest',
sourceType: 'module',
},
root: true,
plugins: ['react', 'unused-imports', 'react-hooks', 'prettier'],
rules: {
'prettier/prettier': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'warn',
'unused-imports/no-unused-imports': 'error',
'react-hooks/rules-of-hooks': 'warn',
'react-hooks/exhaustive-deps': 'warn',
'react/no-unescaped-entities': 'off',
'react/react-in-jsx-scope': 'off',
'prefer-const': 'warn',
'no-self-assign': 'warn',
'multiline-ternary': 'off',
'no-case-declarations': 'warn',
'array-callback-return': 'warn',
'no-prototype-builtins': 'warn',
'constructor-super': 'warn',
'prefer-regex-literals': 'warn',
eqeqeq: 'warn',
'no-empty': 'warn',
'valid-typeof': 'warn',
'react/display-name': 'warn',
'no-unsafe-finally': 'warn',
'no-async-promise-executor': 'warn',
'react/no-find-dom-node': 'warn',
'no-import-assign': 'warn',
'react/no-unknown-property': 'warn',
'react/prop-types': 'warn',
'no-dupe-keys': 'warn',
'no-useless-escape': 'warn',
'prefer-promise-reject-errors': 'warn',
'@typescript-eslint/return-await': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-redeclare': 'warn',
'@typescript-eslint/no-empty-interface': 'warn',
'@typescript-eslint/no-base-to-string': 'warn',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/method-signature-style': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/no-namespace': 'warn',
'@typescript-eslint/no-dynamic-delete': 'warn',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-invalid-void-type': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'@typescript-eslint/consistent-type-assertions': 'off',
},
settings: {
react: {
version: 'detect',
},
},
// Workaround for a bug regarding .d.ts files
ignorePatterns: ['*.d.ts'],
};
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: true,
singleQuote: true,
printWidth: 80,
};
10 changes: 0 additions & 10 deletions app/.editorconfig

This file was deleted.

34 changes: 0 additions & 34 deletions app/.eslintignore

This file was deleted.

50 changes: 0 additions & 50 deletions app/.eslintrc.js

This file was deleted.

7 changes: 0 additions & 7 deletions app/.holium/configs/.eslintrc

This file was deleted.

8 changes: 0 additions & 8 deletions app/.holium/scripts/.eslintrc

This file was deleted.

30 changes: 0 additions & 30 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@
"@types/valid-url": "^1.0.3",
"@types/webpack-bundle-analyzer": "^4.4.1",
"@types/webpack-env": "^1.16.3",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.20.0",
"asar": "^3.2.0",
"browserslist-config-erb": "^0.0.3",
"chalk": "^4.1.2",
Expand All @@ -141,27 +139,13 @@
"electron-notarize": "^1.2.1",
"electron-rebuild": "^3.2.7",
"electronmon": "^2.0.2",
"eslint": "^8.12.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-erb": "^4.0.3",
"eslint-import-resolver-custom-alias": "^1.3.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-compat": "^4.0.2",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.4.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.5.1",
"lint-staged": "^12.3.7",
"mini-css-extract-plugin": "^2.6.0",
"opencollective-postinstall": "^2.0.3",
"prettier": "^2.6.2",
"react-refresh": "^0.12.0",
"react-refresh-typescript": "^2.0.4",
"react-test-renderer": "^18.0.0",
Expand All @@ -186,20 +170,6 @@
"npm": ">=7.x"
},
"browserslist": [],
"prettier": {
"overrides": [
{
"files": [
".prettierrc",
".eslintrc"
],
"options": {
"parser": "json"
}
}
],
"singleQuote": true
},
"workspaces": {
"packages": [
"*"
Expand Down
6 changes: 0 additions & 6 deletions lib/conduit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
"build:prod": "preconstruct build",
"fix": "preconstruct fix"
},
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"devDependencies": {
"@babel/core": "^7.18.9",
"@babel/preset-env": "^7.18.9",
Expand Down
2 changes: 1 addition & 1 deletion lib/conduit/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
"noImplicitReturns": true,
"noImplicitThis": true
},
"include": ["src"]
"include": ["src", "test"]
}
6 changes: 0 additions & 6 deletions lib/multiplayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
"build": "preconstruct build",
"build:prod": "preconstruct build"
},
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"preconstruct": {
"globals": {
"react": "React"
Expand Down
6 changes: 0 additions & 6 deletions lib/room/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
"build": "preconstruct build",
"build:prod": "preconstruct build"
},
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"preconstruct": {
"globals": {
"mobx": "mobx"
Expand Down
4 changes: 2 additions & 2 deletions lib/room/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"noImplicitReturns": true,
"noImplicitThis": true
},
"include": ["src"],
"exclude": ["test", "dist"]
"include": ["src", "tests"],
"exclude": ["dist"]
}
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"build:conduit": "yarn workspace @holium/conduit build",
"build:multiplayer": "yarn workspace @holium/realm-multiplayer build",
"build:room": "yarn workspace @holium/realm-room build",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --ignore-path .gitignore",
"start": "yarn workspace @holium/realm start",
"add:realm": "yarn workspace @holium/realm add -W",
"package": "yarn workspace @holium/realm package",
Expand Down Expand Up @@ -40,5 +41,20 @@
"react-virtuoso": "^2.18.0",
"react-window": "^1.8.7"
},
"version": "0.0.1"
"version": "0.0.1",
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard-with-typescript": "^23.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unused-imports": "^2.0.0",
"prettier": "^2.7.1"
}
}
2 changes: 1 addition & 1 deletion playground/ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
"noImplicitReturns": false,
"noImplicitThis": false
},
"include": ["./src"]
"include": ["./src", "vite.config.ts"]
}
4 changes: 4 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This file makes sure the .eslintrc.js file itself is being linted
{
"include": [".eslintrc.js"]
}
Loading

0 comments on commit 0932189

Please sign in to comment.