Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix eslint crashing issues #1951

Merged
merged 9 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions .eslintrc.json

This file was deleted.

Binary file not shown.
60 changes: 60 additions & 0 deletions common.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'prettier'],
ignorePatterns: ['**/*.spec.ts'],
rules: {
'standard/no-callback-literal': 0, // Disable this as we have too many callbacks relying on literals
'no-throw-literal': 0,
camelcase: 'off',
'sort-imports': 'off',
'eol-last': 'error',
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
'no-trailing-spaces': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: false,
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-floating-promises': ['error'],
'block-scoped-var': 'error',
'comma-dangle': ['error', 'always-multiline'],
curly: ['error', 'all'],
'no-confusing-arrow': 'error',
'no-inline-comments': 'warn',
'no-invalid-this': 'error',
'no-return-assign': 'warn',
'no-constructor-return': 'error',
'no-duplicate-imports': 'error',
'no-self-compare': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-unmodified-loop-condition': 'error',
'no-unused-private-class-members': 'error',
'object-curly-spacing': ['error', 'always'],
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'never'],
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'all',
printWidth: 120,
semi: false,
},
{
usePrettierrc: false,
},
],
},
}
4 changes: 0 additions & 4 deletions linter.tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/api/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/api/.eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions packages/api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
extends: ['../../common.eslintrc.js'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
ignorePatterns: ['**/*.spec.ts'],
}
4 changes: 0 additions & 4 deletions packages/api/linter.tsconfig.json

This file was deleted.

4 changes: 2 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"start": "tsc -p tsconfig.json --watch",
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix",
"test": "jest spec --coverage"
},
"devDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions packages/desktop/.eslintignore

This file was deleted.

16 changes: 0 additions & 16 deletions packages/desktop/.eslintrc

This file was deleted.

16 changes: 16 additions & 0 deletions packages/desktop/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
extends: ['../../common.eslintrc.js'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
ignorePatterns: ['**/*.spec.ts', '@types', 'node_modules', 'dist'],
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }],
'@typescript-eslint/no-var-requires': 'off',
},
globals: {
zip: true,
},
}
4 changes: 2 additions & 2 deletions packages/desktop/app/javascripts/Renderer/Renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const loadAndStartApplication = async () => {

window.device = await createDesktopDevice(remoteBridge)

window.startApplication(DEFAULT_SYNC_SERVER, window.device, window.enableUnfinishedFeatures, WEBSOCKET_URL)
return window.startApplication(DEFAULT_SYNC_SERVER, window.device, window.enableUnfinishedFeatures, WEBSOCKET_URL)
}

window.onload = () => {
Expand Down Expand Up @@ -154,5 +154,5 @@ window.electronMainEvents.handleWindowFocused(() => {
})

window.electronMainEvents.handleInstallComponentComplete((_: IpcRendererEvent, data: any) => {
window.webClient.onComponentInstallationComplete(data.component, undefined)
void window.webClient.onComponentInstallationComplete(data.component, undefined)
})
3 changes: 0 additions & 3 deletions packages/desktop/linter.tsconfig.json

This file was deleted.

5 changes: 2 additions & 3 deletions packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"dev": "NODE_ENV=development webpack --config desktop.webpack.dev.js --watch",
"format": "prettier --write .",
"lint:eslint": "eslint app/index.ts app/application.ts app/javascripts/**/*.ts",
"lint:formatting": "prettier --check .",
"lint": "yarn lint:formatting && yarn lint:eslint",
"lint:formatting": "prettier --check app",
"lint": "yarn lint:formatting && yarn lint:eslint app",
"tsc": "tsc --noEmit",
"release:mac": "node scripts/build.mjs mac",
"start": "electron ./app --enable-logging --icon _icon/icon.png",
Expand Down Expand Up @@ -58,7 +58,6 @@
"@types/proxyquire": "^1.3.28",
"@types/yauzl": "^2.10.0",
"ava": "^4.3.3",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.5",
"copy-webpack-plugin": "^10.2.4",
"electron-builder": "23.3.3",
Expand Down
2 changes: 0 additions & 2 deletions packages/encryption/.eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions packages/encryption/.eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions packages/encryption/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
extends: ['../../common.eslintrc.js'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
ignorePatterns: ['**/*.spec.ts'],
}
4 changes: 0 additions & 4 deletions packages/encryption/linter.tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/encryption/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"start": "tsc -p tsconfig.json --watch",
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"lint": "eslint src --ext .ts",
"format": "prettier --write src",
"test": "jest"
},
Expand Down
2 changes: 0 additions & 2 deletions packages/features/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/features/.eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions packages/features/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
extends: ['../../common.eslintrc.js'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
ignorePatterns: ['**/*.spec.ts'],
}
4 changes: 0 additions & 4 deletions packages/features/linter.tsconfig.json

This file was deleted.

5 changes: 3 additions & 2 deletions packages/features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"start": "tsc -p tsconfig.json --watch",
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"lint": "eslint src --ext .ts",
"test": "jest"
},
"dependencies": {
Expand All @@ -32,7 +32,8 @@
},
"devDependencies": {
"@types/jest": "^28.1.5",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/eslint-plugin": "*",
"eslint": "*",
"eslint-plugin-prettier": "*",
"jest": "^28.1.2",
"ts-jest": "^28.0.5",
Expand Down
3 changes: 0 additions & 3 deletions packages/filepicker/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/filepicker/.eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions packages/filepicker/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
extends: ['../../common.eslintrc.js'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
ignorePatterns: ['**/*.spec.ts'],
}
1 change: 0 additions & 1 deletion packages/filepicker/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@babel/preset-typescript": "^7.15.0",
"@standardnotes/config": "^2.2.0",
"@types/wicg-native-file-system": "^2020.6.0",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.3",
"html-webpack-plugin": "^5.5.0",
"ts-loader": "^9.2.6",
Expand Down
4 changes: 0 additions & 4 deletions packages/filepicker/linter.tsconfig.json

This file was deleted.

3 changes: 2 additions & 1 deletion packages/filepicker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
"start": "tsc -p tsconfig.json --watch",
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"lint": "eslint src --ext .ts",
"test": "jest"
},
"devDependencies": {
"@types/jest": "^28.1.5",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"eslint": "*",
"eslint-plugin-prettier": "*",
"jest": "^28.1.2",
"ts-jest": "^28.0.5",
Expand Down
2 changes: 0 additions & 2 deletions packages/files/.eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions packages/files/.eslintrc

This file was deleted.

9 changes: 9 additions & 0 deletions packages/files/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
extends: ['../../common.eslintrc.js'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
ignorePatterns: ['**/*.spec.ts'],
}
4 changes: 0 additions & 4 deletions packages/files/linter.tsconfig.json

This file was deleted.

3 changes: 2 additions & 1 deletion packages/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
"start": "tsc -p tsconfig.json --watch",
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"lint": "eslint src --ext .ts",
"test": "jest"
},
"devDependencies": {
"@types/jest": "^28.1.5",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"eslint": "*",
"eslint-plugin-prettier": "*",
"jest": "^28.1.2",
"ts-jest": "^28.0.5"
Expand Down
9 changes: 0 additions & 9 deletions packages/mobile/.eslintignore

This file was deleted.

14 changes: 0 additions & 14 deletions packages/mobile/.eslintrc

This file was deleted.