element-desktop/.eslintrc-hak.js
Andy Balaam 1271c22aee Separate linting and compiling src+test, scripts and hak
Inspired by the failure of https://github.com/vector-im/element-desktop/pull/529
to lint our code with the @typescript-eslint/no-base-to-string rule
turned on, I found we needed to add a parserOptions.project to our
.eslintrc.js, pointing to the tsconfig.json.

This led to more fixes, because we have 3 tsconfig.json files for
src+test, scripts and hak and the single eslintrc was complaining that
it could see more files than the tsconfig file knew about.

So, I think the right split is to have one eslintrc file and one
tsconfig for each of the three projects.
2023-02-17 12:17:42 +00:00

38 lines
1.2 KiB
JavaScript

module.exports = {
plugins: ["matrix-org"],
extends: ["plugin:matrix-org/javascript"],
parserOptions: {
ecmaVersion: 2021,
project: ["hak/tsconfig.json"],
},
env: {
es6: true,
node: true,
// we also have some browser code (ie. the preload script)
browser: true,
},
// NOTE: These rules are frozen and new rules should not be added here.
// New changes belong in https://github.com/matrix-org/eslint-plugin-matrix-org/
rules: {
"quotes": "off",
"indent": "off",
"prefer-promise-reject-errors": "off",
"no-async-promise-executor": "off",
},
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",
},
},
],
};