mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 13:39:58 +01:00
Merge pull request #546 from vector-im/andybalaam/harmonise-eslintrc-tsconfig
Separate linting and compiling src+test, scripts and hak
This commit is contained in:
commit
a528d8c7c5
22
.eslintrc-hak.js
Normal file
22
.eslintrc-hak.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: ["matrix-org"],
|
||||||
|
extends: [".eslintrc.js"],
|
||||||
|
parserOptions: {
|
||||||
|
project: ["hak/tsconfig.json"],
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ["hak/**/*.ts"],
|
||||||
|
extends: ["plugin:matrix-org/typescript"],
|
||||||
|
rules: {
|
||||||
|
// Things we do that break the ideal style
|
||||||
|
"prefer-promise-reject-errors": "off",
|
||||||
|
"quotes": "off",
|
||||||
|
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
// We're okay with assertion errors when we ask for them
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
22
.eslintrc-scripts.js
Normal file
22
.eslintrc-scripts.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: ["matrix-org"],
|
||||||
|
extends: [".eslintrc.js"],
|
||||||
|
parserOptions: {
|
||||||
|
project: ["scripts/tsconfig.json"],
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ["scripts/**/*.ts"],
|
||||||
|
extends: ["plugin:matrix-org/typescript"],
|
||||||
|
rules: {
|
||||||
|
// Things we do that break the ideal style
|
||||||
|
"prefer-promise-reject-errors": "off",
|
||||||
|
"quotes": "off",
|
||||||
|
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
// We're okay with assertion errors when we ask for them
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
22
.eslintrc-test.js
Normal file
22
.eslintrc-test.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: ["matrix-org"],
|
||||||
|
extends: [".eslintrc.js"],
|
||||||
|
parserOptions: {
|
||||||
|
project: ["test/tsconfig.json"],
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ["test/**/*.ts"],
|
||||||
|
extends: ["plugin:matrix-org/typescript"],
|
||||||
|
rules: {
|
||||||
|
// Things we do that break the ideal style
|
||||||
|
"prefer-promise-reject-errors": "off",
|
||||||
|
"quotes": "off",
|
||||||
|
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
// We're okay with assertion errors when we ask for them
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -3,6 +3,7 @@ module.exports = {
|
|||||||
extends: ["plugin:matrix-org/javascript"],
|
extends: ["plugin:matrix-org/javascript"],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
ecmaVersion: 2021,
|
ecmaVersion: 2021,
|
||||||
|
project: ["tsconfig.json"],
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
es6: true,
|
es6: true,
|
||||||
@ -20,7 +21,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
files: ["{src,scripts,hak}/**/*.{ts,tsx}"],
|
files: ["src/**/*.ts"],
|
||||||
extends: ["plugin:matrix-org/typescript"],
|
extends: ["plugin:matrix-org/typescript"],
|
||||||
rules: {
|
rules: {
|
||||||
// Things we do that break the ideal style
|
// Things we do that break the ideal style
|
||||||
|
18
package.json
18
package.json
@ -20,9 +20,21 @@
|
|||||||
"asar-webapp": "asar p webapp webapp.asar",
|
"asar-webapp": "asar p webapp webapp.asar",
|
||||||
"start": "yarn run build:ts && yarn run build:res && electron .",
|
"start": "yarn run build:ts && yarn run build:res && electron .",
|
||||||
"lint": "yarn lint:types && yarn lint:js",
|
"lint": "yarn lint:types && yarn lint:js",
|
||||||
"lint:js": "eslint --max-warnings 0 src scripts hak",
|
"lint:js": "yarn lint:js:src && yarn lint:js:test && yarn lint:js:scripts && yarn lint:js:hak",
|
||||||
"lint:js-fix": "eslint --fix src scripts hak",
|
"lint:js:src": "eslint --max-warnings 0 src",
|
||||||
"lint:types": "tsc --noEmit && tsc -p scripts/tsconfig.json --noEmit && tsc -p hak/tsconfig.json --noEmit",
|
"lint:js:test": "eslint --max-warnings 0 --config .eslintrc-test.js test",
|
||||||
|
"lint:js:scripts": "eslint --max-warnings 0 --config .eslintrc-scripts.js scripts",
|
||||||
|
"lint:js:hak": "eslint --max-warnings 0 --config .eslintrc-hak.js hak",
|
||||||
|
"lint:js-fix": "yarn lint:js-fix:src &&yarn lint:js-fix:test && yarn lint:js-fix:scripts && yarn lint:js-fix:hak",
|
||||||
|
"lint:js-fix:src": "eslint --fix --max-warnings 0 src",
|
||||||
|
"lint:js-fix:test": "eslint --fix --max-warnings 0 --config .eslintrc-test.js test",
|
||||||
|
"lint:js-fix:scripts": "eslint --fix --max-warnings 0 --config .eslintrc-scripts.js scripts",
|
||||||
|
"lint:js-fix:hak": "eslint --fix --max-warnings 0 --config .eslintrc-hak.js hak",
|
||||||
|
"lint:types": "yarn lint:types:src && yarn lint:types:test && yarn lint:types:scripts && yarn lint:types:hak",
|
||||||
|
"lint:types:src": "tsc --noEmit",
|
||||||
|
"lint:types:test": "tsc --noEmit -p test/tsconfig.json",
|
||||||
|
"lint:types:scripts": "tsc --noEmit -p scripts/tsconfig.json",
|
||||||
|
"lint:types:hak": "tsc --noEmit -p hak/tsconfig.json",
|
||||||
"build:native": "yarn run hak",
|
"build:native": "yarn run hak",
|
||||||
"build:native:universal": "yarn run hak --target x86_64-apple-darwin fetchandbuild && yarn run hak --target aarch64-apple-darwin fetchandbuild && yarn run hak --target x86_64-apple-darwin --target aarch64-apple-darwin copyandlink",
|
"build:native:universal": "yarn run hak --target x86_64-apple-darwin fetchandbuild && yarn run hak --target aarch64-apple-darwin fetchandbuild && yarn run hak --target x86_64-apple-darwin --target aarch64-apple-darwin copyandlink",
|
||||||
"build:32": "yarn run build:ts && yarn run build:res && electron-builder --ia32",
|
"build:32": "yarn run build:ts && yarn run build:res && electron-builder --ia32",
|
||||||
|
16
test/tsconfig.json
Normal file
16
test/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"target": "es2017",
|
||||||
|
"module": "commonjs",
|
||||||
|
"sourceMap": false,
|
||||||
|
"strict": true,
|
||||||
|
"lib": ["es2019", "dom"]
|
||||||
|
},
|
||||||
|
"include": ["./**/*.ts"],
|
||||||
|
"ts-node": {
|
||||||
|
"transpileOnly": true
|
||||||
|
}
|
||||||
|
}
|
@ -9,10 +9,10 @@
|
|||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"typeRoots": ["src/@types"],
|
"typeRoots": ["src/@types", "node_modules/@types"],
|
||||||
"lib": ["es2019", "dom"],
|
"lib": ["es2019", "dom"],
|
||||||
"types": ["jest", "node"],
|
"types": ["node"],
|
||||||
"strict": true
|
"strict": true
|
||||||
},
|
},
|
||||||
"include": ["./src/**/*.ts", "./tests/**/*.ts"]
|
"include": ["./src/**/*.ts"]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user