chore: fix eslint crashing issues (#1951)
This commit is contained in:
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["./node_modules/@standardnotes/config/src/.eslintrc"],
|
|
||||||
"rules": {
|
|
||||||
"max-classes-per-file": ["error", 1]
|
|
||||||
},
|
|
||||||
"ignorePatterns": [".eslintrc.js", "*.webpack.*.js", "webpack-defaults.js", "jest.config.js", "__mocks__", "**/**/coverage"]
|
|
||||||
}
|
|
||||||
Binary file not shown.
60
common.eslintrc.js
Normal file
60
common.eslintrc.js
Normal file
@@ -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,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"exclude": ["node_modules"],
|
|
||||||
"extends": "./node_modules/@standardnotes/config/src/linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
coverage
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/api/.eslintrc.js
Normal file
9
packages/api/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"lint:fix": "eslint . --ext .ts --fix",
|
"lint:fix": "eslint src --ext .ts --fix",
|
||||||
"test": "jest spec --coverage"
|
"test": "jest spec --coverage"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
jsign
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"node": true,
|
|
||||||
"commonjs": true
|
|
||||||
},
|
|
||||||
"extends": ["../../.eslintrc.json"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off",
|
|
||||||
"@typescript-eslint/no-explicit-any": "warn",
|
|
||||||
"@typescript-eslint/no-var-requires": "off"
|
|
||||||
},
|
|
||||||
"globals": {
|
|
||||||
"zip": true
|
|
||||||
},
|
|
||||||
"ignorePatterns": ["scripts"]
|
|
||||||
}
|
|
||||||
16
packages/desktop/.eslintrc.js
Normal file
16
packages/desktop/.eslintrc.js
Normal file
@@ -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,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -41,7 +41,7 @@ const loadAndStartApplication = async () => {
|
|||||||
|
|
||||||
window.device = await createDesktopDevice(remoteBridge)
|
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 = () => {
|
window.onload = () => {
|
||||||
@@ -154,5 +154,5 @@ window.electronMainEvents.handleWindowFocused(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
window.electronMainEvents.handleInstallComponentComplete((_: IpcRendererEvent, data: any) => {
|
window.electronMainEvents.handleInstallComponentComplete((_: IpcRendererEvent, data: any) => {
|
||||||
window.webClient.onComponentInstallationComplete(data.component, undefined)
|
void window.webClient.onComponentInstallationComplete(data.component, undefined)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../node_modules/@standardnotes/config/src/linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
"dev": "NODE_ENV=development webpack --config desktop.webpack.dev.js --watch",
|
"dev": "NODE_ENV=development webpack --config desktop.webpack.dev.js --watch",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"lint:eslint": "eslint app/index.ts app/application.ts app/javascripts/**/*.ts",
|
"lint:eslint": "eslint app/index.ts app/application.ts app/javascripts/**/*.ts",
|
||||||
"lint:formatting": "prettier --check .",
|
"lint:formatting": "prettier --check app",
|
||||||
"lint": "yarn lint:formatting && yarn lint:eslint",
|
"lint": "yarn lint:formatting && yarn lint:eslint app",
|
||||||
"tsc": "tsc --noEmit",
|
"tsc": "tsc --noEmit",
|
||||||
"release:mac": "node scripts/build.mjs mac",
|
"release:mac": "node scripts/build.mjs mac",
|
||||||
"start": "electron ./app --enable-logging --icon _icon/icon.png",
|
"start": "electron ./app --enable-logging --icon _icon/icon.png",
|
||||||
@@ -58,7 +58,6 @@
|
|||||||
"@types/proxyquire": "^1.3.28",
|
"@types/proxyquire": "^1.3.28",
|
||||||
"@types/yauzl": "^2.10.0",
|
"@types/yauzl": "^2.10.0",
|
||||||
"ava": "^4.3.3",
|
"ava": "^4.3.3",
|
||||||
"babel-eslint": "^10.1.0",
|
|
||||||
"babel-loader": "^8.2.5",
|
"babel-loader": "^8.2.5",
|
||||||
"copy-webpack-plugin": "^10.2.4",
|
"copy-webpack-plugin": "^10.2.4",
|
||||||
"electron-builder": "23.3.3",
|
"electron-builder": "23.3.3",
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-explicit-any": ["warn", { "ignoreRestArgs": true }],
|
|
||||||
"@typescript-eslint/no-non-null-assertion": "warn"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/encryption/.eslintrc.js
Normal file
9
packages/encryption/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"format": "prettier --write src",
|
"format": "prettier --write src",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/features/.eslintrc.js
Normal file
9
packages/features/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -32,7 +32,8 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^28.1.5",
|
"@types/jest": "^28.1.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
"@typescript-eslint/eslint-plugin": "*",
|
||||||
|
"eslint": "*",
|
||||||
"eslint-plugin-prettier": "*",
|
"eslint-plugin-prettier": "*",
|
||||||
"jest": "^28.1.2",
|
"jest": "^28.1.2",
|
||||||
"ts-jest": "^28.0.5",
|
"ts-jest": "^28.0.5",
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
example
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/filepicker/.eslintrc.js
Normal file
9
packages/filepicker/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -24,7 +24,6 @@
|
|||||||
"@babel/preset-typescript": "^7.15.0",
|
"@babel/preset-typescript": "^7.15.0",
|
||||||
"@standardnotes/config": "^2.2.0",
|
"@standardnotes/config": "^2.2.0",
|
||||||
"@types/wicg-native-file-system": "^2020.6.0",
|
"@types/wicg-native-file-system": "^2020.6.0",
|
||||||
"babel-eslint": "^10.1.0",
|
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
"html-webpack-plugin": "^5.5.0",
|
"html-webpack-plugin": "^5.5.0",
|
||||||
"ts-loader": "^9.2.6",
|
"ts-loader": "^9.2.6",
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist", "example"]
|
|
||||||
}
|
|
||||||
@@ -19,12 +19,13 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^28.1.5",
|
"@types/jest": "^28.1.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
||||||
|
"eslint": "*",
|
||||||
"eslint-plugin-prettier": "*",
|
"eslint-plugin-prettier": "*",
|
||||||
"jest": "^28.1.2",
|
"jest": "^28.1.2",
|
||||||
"ts-jest": "^28.0.5",
|
"ts-jest": "^28.0.5",
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/files/.eslintrc.js
Normal file
9
packages/files/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -19,12 +19,13 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^28.1.5",
|
"@types/jest": "^28.1.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
||||||
|
"eslint": "*",
|
||||||
"eslint-plugin-prettier": "*",
|
"eslint-plugin-prettier": "*",
|
||||||
"jest": "^28.1.2",
|
"jest": "^28.1.2",
|
||||||
"ts-jest": "^28.0.5"
|
"ts-jest": "^28.0.5"
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
metro.config.js
|
|
||||||
html/**/*
|
|
||||||
node_modules
|
|
||||||
ios
|
|
||||||
e2e
|
|
||||||
android
|
|
||||||
fastlane
|
|
||||||
WebFrame
|
|
||||||
__tests__
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"env": {
|
|
||||||
"node": true,
|
|
||||||
"commonjs": true
|
|
||||||
},
|
|
||||||
"extends": ["@react-native-community", "plugin:react-hooks/recommended", "../../.eslintrc.json"],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "warn",
|
|
||||||
"@typescript-eslint/no-explicit-any": "warn",
|
|
||||||
"@typescript-eslint/no-var-requires": "off",
|
|
||||||
"eqeqeq": ["off"],
|
|
||||||
"no-void": ["off"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
13
packages/mobile/.eslintrc.js
Normal file
13
packages/mobile/.eslintrc.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js', 'plugin:react-hooks/recommended'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts', '__mocks__'],
|
||||||
|
plugins: ['@typescript-eslint', 'react', 'react-hooks', 'prettier'],
|
||||||
|
rules: {
|
||||||
|
'no-console': 'warn',
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"ios-dev": "react-native run-ios --scheme StandardNotesDev",
|
"ios-dev": "react-native run-ios --scheme StandardNotesDev",
|
||||||
"ios-prod": "react-native run-ios --scheme StandardNotes",
|
"ios-prod": "react-native run-ios --scheme StandardNotes",
|
||||||
"lint:fix": "yarn lint --fix",
|
"lint:fix": "yarn lint --fix",
|
||||||
"lint": "yarn tsc && yarn eslint . --ext .ts,.tsx",
|
"lint": "yarn eslint src --ext .ts,.tsx",
|
||||||
"pods": "yarn install:pods",
|
"pods": "yarn install:pods",
|
||||||
"start": "react-native start",
|
"start": "react-native start",
|
||||||
"tsc": "tsc --noEmit",
|
"tsc": "tsc --noEmit",
|
||||||
|
|||||||
@@ -17,16 +17,5 @@
|
|||||||
"target": "esnext",
|
"target": "esnext",
|
||||||
"typeRoots": ["node_modules/@types", "./src/Types/*"]
|
"typeRoots": ["node_modules/@types", "./src/Types/*"]
|
||||||
},
|
},
|
||||||
"exclude": [
|
"include": ["src"]
|
||||||
"node_modules",
|
|
||||||
"babel.config.js",
|
|
||||||
"metro.config.js",
|
|
||||||
"jest.config.js",
|
|
||||||
"e2e",
|
|
||||||
"html",
|
|
||||||
"android",
|
|
||||||
"WebFrame",
|
|
||||||
"ios",
|
|
||||||
"fastlane"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-explicit-any": ["warn", { "ignoreRestArgs": true }],
|
|
||||||
"@typescript-eslint/no-non-null-assertion": "warn"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/models/.eslintrc.js
Normal file
9
packages/models/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -9,5 +9,5 @@
|
|||||||
"src/**/*"
|
"src/**/*"
|
||||||
],
|
],
|
||||||
"references": [],
|
"references": [],
|
||||||
"exclude": ["**/*.spec.ts", "dist", "node_modules"]
|
"exclude": ["**/*.spec.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
coverage
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/responses/.eslintrc.js
Normal file
9
packages/responses/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -20,12 +20,13 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"test": "jest spec --coverage --passWithNoTests"
|
"test": "jest spec --coverage --passWithNoTests"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^28.1.5",
|
"@types/jest": "^28.1.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
||||||
|
"eslint": "*",
|
||||||
"eslint-plugin-prettier": "*",
|
"eslint-plugin-prettier": "*",
|
||||||
"jest": "^28.1.2",
|
"jest": "^28.1.2",
|
||||||
"ts-jest": "^28.0.5"
|
"ts-jest": "^28.0.5"
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
coverage
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-explicit-any": ["warn", { "ignoreRestArgs": true }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/services/.eslintrc.js
Normal file
9
packages/services/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"lint:fix": "eslint . --ext .ts --fix",
|
"lint:fix": "eslint src --ext .ts --fix",
|
||||||
"test": "jest spec --coverage"
|
"test": "jest spec --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
dist
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/sncrypto-common/.eslintrc.js
Normal file
9
packages/sncrypto-common/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -20,12 +20,13 @@
|
|||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"watch": "tsc -p tsconfig.json --watch",
|
"watch": "tsc -p tsconfig.json --watch",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"test": "yarn lint"
|
"test": "yarn lint"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
||||||
"@typescript-eslint/parser": "^5.12.1",
|
"@typescript-eslint/parser": "^5.12.1",
|
||||||
|
"eslint": "*",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"typescript": "*"
|
"typescript": "*"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
dist
|
|
||||||
test
|
|
||||||
*.config.js
|
|
||||||
test-server.js
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/sncrypto-web/.eslintrc.js
Normal file
9
packages/sncrypto-web/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "webpack --mode production && tsc",
|
"build": "webpack --mode production && tsc",
|
||||||
"watch": "webpack --mode production --watch",
|
"watch": "webpack --mode production --watch",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"test:e2e": "node test-server.js"
|
"test:e2e": "node test-server.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
test
|
|
||||||
*.config.js
|
|
||||||
mocha/**/*
|
|
||||||
coverage
|
|
||||||
e2e-server.js
|
|
||||||
jest-global.ts
|
|
||||||
webpack.*.js
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc.json",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-explicit-any": ["warn", { "ignoreRestArgs": true }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/snjs/.eslintrc.js
Normal file
9
packages/snjs/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './lib/tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"source": {
|
|
||||||
"includePattern": ".+\\.js(doc|x)?$",
|
|
||||||
"include": ["lib"],
|
|
||||||
"exclude": ["node_modules"]
|
|
||||||
},
|
|
||||||
"recurseDepth": 10,
|
|
||||||
"opts": {
|
|
||||||
"destination": "./docs/",
|
|
||||||
"recurse": true,
|
|
||||||
"template": "node_modules/docdash"
|
|
||||||
},
|
|
||||||
"tags": {
|
|
||||||
"allowUnknownTags": true,
|
|
||||||
"dictionaries": ["jsdoc", "closure"]
|
|
||||||
},
|
|
||||||
"docdash": {
|
|
||||||
"meta": {
|
|
||||||
"title": "SNJS Documentation"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
"build": "yarn tsc && webpack --config webpack.prod.js",
|
"build": "yarn tsc && webpack --config webpack.prod.js",
|
||||||
"docs": "jsdoc -c jsdoc.json",
|
"docs": "jsdoc -c jsdoc.json",
|
||||||
"tsc": "tsc --project lib/tsconfig.json && tscpaths -p lib/tsconfig.json -s lib -o dist/@types",
|
"tsc": "tsc --project lib/tsconfig.json && tscpaths -p lib/tsconfig.json -s lib -o dist/@types",
|
||||||
"lint": "yarn lint:tsc && yarn lint:eslint",
|
"lint": "yarn lint:eslint lib",
|
||||||
"lint:eslint": "eslint --ext .ts lib/",
|
"lint:eslint": "eslint --ext .ts lib/",
|
||||||
"lint:fix": "eslint --fix --ext .ts lib/",
|
"lint:fix": "eslint --fix --ext .ts lib/",
|
||||||
"lint:tsc": "tsc --noEmit --emitDeclarationOnly false --project lib/tsconfig.json",
|
"lint:tsc": "tsc --noEmit --emitDeclarationOnly false --project lib/tsconfig.json",
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
webpack.config.js
|
|
||||||
9
packages/styles/.eslintrc.js
Normal file
9
packages/styles/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["../../node_modules/@standardnotes/config/src/.eslintrc"],
|
|
||||||
"ignorePatterns": [".eslintrc.js", "webpack.config.js"]
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../node_modules/@standardnotes/config/src/linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
9
packages/toast/.eslintrc.js
Normal file
9
packages/toast/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["../../node_modules/@standardnotes/config/src/.eslintrc"],
|
|
||||||
"ignorePatterns": [".eslintrc.js", "*.webpack.*.js", "webpack-defaults.js", "jest.config.js", "__mocks__"]
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../node_modules/@standardnotes/config/src/linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
coverage
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
},
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-explicit-any": ["warn", { "ignoreRestArgs": true }]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/ui-services/.eslintrc.js
Normal file
9
packages/ui-services/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"test": "jest spec"
|
"test": "jest spec"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
"@types/jest": "^28.1.5",
|
"@types/jest": "^28.1.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
||||||
"@typescript-eslint/parser": "^5.12.1",
|
"@typescript-eslint/parser": "^5.12.1",
|
||||||
|
"eslint": "*",
|
||||||
"eslint-plugin-prettier": "*",
|
"eslint-plugin-prettier": "*",
|
||||||
"jest": "^28.1.2",
|
"jest": "^28.1.2",
|
||||||
"ts-jest": "^28.0.5",
|
"ts-jest": "^28.0.5",
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "../../.eslintrc",
|
|
||||||
"parserOptions": {
|
|
||||||
"project": "./linter.tsconfig.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
9
packages/utils/.eslintrc.js
Normal file
9
packages/utils/.eslintrc.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts'],
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist"]
|
|
||||||
}
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"start": "tsc -p tsconfig.json --watch",
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
"prebuild": "yarn clean",
|
"prebuild": "yarn clean",
|
||||||
"build": "tsc -p tsconfig.json",
|
"build": "tsc -p tsconfig.json",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint src --ext .ts",
|
||||||
"test": "jest spec"
|
"test": "jest spec"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
"@types/lodash": "^4.14.179",
|
"@types/lodash": "^4.14.179",
|
||||||
"@types/node": "^18.0.0",
|
"@types/node": "^18.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
||||||
|
"eslint": "*",
|
||||||
"eslint-plugin-prettier": "*",
|
"eslint-plugin-prettier": "*",
|
||||||
"jest": "^28.1.2",
|
"jest": "^28.1.2",
|
||||||
"jsdom": "^20.0.0",
|
"jsdom": "^20.0.0",
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
dist
|
|
||||||
node_modules
|
|
||||||
web.webpack-defaults.js
|
|
||||||
coverage
|
|
||||||
src/components
|
|
||||||
src/favicon
|
|
||||||
src/vendor
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"root": true,
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"prettier",
|
|
||||||
"plugin:react-hooks/recommended",
|
|
||||||
"../../node_modules/@standardnotes/config/src/.eslintrc"
|
|
||||||
],
|
|
||||||
"plugins": ["@typescript-eslint", "react", "react-hooks"],
|
|
||||||
"ignorePatterns": [
|
|
||||||
"node_modules",
|
|
||||||
"dist",
|
|
||||||
".eslintrc.js",
|
|
||||||
"*.webpack.*.js",
|
|
||||||
"webpack-defaults.js",
|
|
||||||
"jest.config.js",
|
|
||||||
"__mocks__",
|
|
||||||
"src/components",
|
|
||||||
"src/favicon",
|
|
||||||
"src/vendor",
|
|
||||||
"coverage",
|
|
||||||
"*.config.js"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"standard/no-callback-literal": 0, // Disable this as we have too many callbacks relying on literals
|
|
||||||
"no-throw-literal": 0,
|
|
||||||
"no-console": ["warn", { "allow": ["warn", "error"] }],
|
|
||||||
"semi": 1,
|
|
||||||
"camelcase": "warn",
|
|
||||||
"sort-imports": "off",
|
|
||||||
"react-hooks/rules-of-hooks": "error",
|
|
||||||
"react-hooks/exhaustive-deps": "error",
|
|
||||||
"eol-last": "error",
|
|
||||||
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
|
|
||||||
"no-trailing-spaces": "error",
|
|
||||||
"@typescript-eslint/no-explicit-any": "warn",
|
|
||||||
"no-invalid-this": "warn"
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"browser": true
|
|
||||||
},
|
|
||||||
"globals": {
|
|
||||||
"__WEB_VERSION__": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
16
packages/web/.eslintrc.js
Normal file
16
packages/web/.eslintrc.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
extends: ['../../common.eslintrc.js', 'plugin:react-hooks/recommended'],
|
||||||
|
parserOptions: {
|
||||||
|
project: './tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['**/*.spec.ts', "__mocks__"],
|
||||||
|
plugins: ['@typescript-eslint', 'react', 'react-hooks', 'prettier'],
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
},
|
||||||
|
globals: {
|
||||||
|
__WEB_VERSION__: true,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -48,7 +48,7 @@ const ComponentView: FunctionComponent<IProps> = ({ application, onLoad, compone
|
|||||||
const component: SNComponent = componentViewer.component
|
const component: SNComponent = componentViewer.component
|
||||||
|
|
||||||
const manageSubscription = useCallback(() => {
|
const manageSubscription = useCallback(() => {
|
||||||
openSubscriptionDashboard(application)
|
void openSubscriptionDashboard(application)
|
||||||
}, [application])
|
}, [application])
|
||||||
|
|
||||||
const reloadValidityStatus = useCallback(() => {
|
const reloadValidityStatus = useCallback(() => {
|
||||||
|
|||||||
@@ -214,9 +214,9 @@ const ContentListView: FunctionComponent<Props> = ({
|
|||||||
const panelResizeFinishCallback: ResizeFinishCallback = useCallback(
|
const panelResizeFinishCallback: ResizeFinishCallback = useCallback(
|
||||||
(width, _lastLeft, _isMaxWidth, isCollapsed) => {
|
(width, _lastLeft, _isMaxWidth, isCollapsed) => {
|
||||||
if (selectedAsTag) {
|
if (selectedAsTag) {
|
||||||
navigationController.setPanelWidthForTag(selectedAsTag, width)
|
void navigationController.setPanelWidthForTag(selectedAsTag, width)
|
||||||
} else {
|
} else {
|
||||||
application.setPreference(PrefKey.NotesPanelWidth, width).catch(console.error)
|
void application.setPreference(PrefKey.NotesPanelWidth, width).catch(console.error)
|
||||||
}
|
}
|
||||||
application.publishPanelDidResizeEvent(PANEL_NAME_NOTES, isCollapsed)
|
application.publishPanelDidResizeEvent(PANEL_NAME_NOTES, isCollapsed)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ const DailyContentList: FunctionComponent<Props> = ({
|
|||||||
const onClickTemplate = useCallback(
|
const onClickTemplate = useCallback(
|
||||||
(date: Date) => {
|
(date: Date) => {
|
||||||
setSelectedDay(date)
|
setSelectedDay(date)
|
||||||
itemListController.createNewNote(undefined, date, 'editor')
|
void itemListController.createNewNote(undefined, date, 'editor')
|
||||||
toggleAppPane(AppPaneId.Editor)
|
toggleAppPane(AppPaneId.Editor)
|
||||||
},
|
},
|
||||||
[setSelectedDay, itemListController, toggleAppPane],
|
[setSelectedDay, itemListController, toggleAppPane],
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const DisplayOptionsMenu: FunctionComponent<DisplayOptionsMenuProps> = ({
|
|||||||
)
|
)
|
||||||
|
|
||||||
const resetTagPreferences = useCallback(() => {
|
const resetTagPreferences = useCallback(() => {
|
||||||
application.mutator.changeAndSaveItem<TagMutator>(selectedTag, (mutator) => {
|
void application.mutator.changeAndSaveItem<TagMutator>(selectedTag, (mutator) => {
|
||||||
mutator.preferences = undefined
|
mutator.preferences = undefined
|
||||||
})
|
})
|
||||||
}, [application, selectedTag])
|
}, [application, selectedTag])
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ const NewNotePreferences: FunctionComponent<Props> = ({
|
|||||||
const setNewNoteTitleFormatChange = (value: string) => {
|
const setNewNoteTitleFormatChange = (value: string) => {
|
||||||
setNewNoteTitleFormat(value as NewNoteTitleFormat)
|
setNewNoteTitleFormat(value as NewNoteTitleFormat)
|
||||||
if (mode === 'global') {
|
if (mode === 'global') {
|
||||||
application.setPreference(PrefKey.NewNoteTitleFormat, value as NewNoteTitleFormat)
|
void application.setPreference(PrefKey.NewNoteTitleFormat, value as NewNoteTitleFormat)
|
||||||
} else {
|
} else {
|
||||||
void changePreferencesCallback({ newNoteTitleFormat: value as NewNoteTitleFormat })
|
void changePreferencesCallback({ newNoteTitleFormat: value as NewNoteTitleFormat })
|
||||||
}
|
}
|
||||||
@@ -168,7 +168,7 @@ const NewNotePreferences: FunctionComponent<Props> = ({
|
|||||||
if (mode === 'tag') {
|
if (mode === 'tag') {
|
||||||
void changePreferencesCallback({ customNoteTitleFormat: newFormat })
|
void changePreferencesCallback({ customNoteTitleFormat: newFormat })
|
||||||
} else {
|
} else {
|
||||||
application.setPreference(PrefKey.CustomNoteTitleFormat, newFormat)
|
void application.setPreference(PrefKey.CustomNoteTitleFormat, newFormat)
|
||||||
}
|
}
|
||||||
}, PrefChangeDebounceTimeInMs)
|
}, PrefChangeDebounceTimeInMs)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const PreviewComponent: FunctionComponent<Props> = ({ application, file, bytes }
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
application.mobileDevice().previewFile(fileBase64, file.name)
|
void application.mobileDevice().previewFile(fileBase64, file.name)
|
||||||
}, [application, bytes, file.mimeType, file.name, isNativeMobileWeb])
|
}, [application, bytes, file.mimeType, file.name, isNativeMobileWeb])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -61,14 +61,14 @@ const LinkedItemBubble = ({
|
|||||||
|
|
||||||
const onUnlinkClick: MouseEventHandler = (event) => {
|
const onUnlinkClick: MouseEventHandler = (event) => {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
unlinkItem(link)
|
void unlinkItem(link)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onKeyDown: KeyboardEventHandler = (event) => {
|
const onKeyDown: KeyboardEventHandler = (event) => {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
case KeyboardKey.Backspace: {
|
case KeyboardKey.Backspace: {
|
||||||
focusPreviousItem()
|
focusPreviousItem()
|
||||||
unlinkItem(link)
|
void unlinkItem(link)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case KeyboardKey.Left:
|
case KeyboardKey.Left:
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user