Share the eslint config

This commit is contained in:
Manav Rathi 2024-02-22 11:17:29 +05:30
parent 199d322939
commit a00f64eaa9
7 changed files with 29 additions and 41 deletions

View file

@ -32,8 +32,3 @@ To see what packages depend on each other locally, use
```sh
yarn workspaces info
```
## Tips
- Too see what tsc is seeing (say when it is trying to type-check `@/utils`),
use `yarn workspace @/utils tsc --showConfig`.

View file

@ -7,3 +7,16 @@ exports various config files that our packages use at build time.
This is _not_ a TypeScript package, nor is it linted. It is not meant to be
transpiled, it just exports static files that can be included verbatim.
### Debugging
Too see what tsc is seeing (say when it is trying to type-check `@/utils`), use
`yarn workspace @/utils tsc --showConfig`.
Similarly, to verify what ESLint is trying to do, use `yarn workspace @/utils
eslint --debug .`
If the issue is in VSCode, open the output window of the corresponding plugin,
it might be telling us what's going wrong there. In particular, when changing
the settings here, you might need to "Developer: Reload Window" in VSCode to get
it to pick up the changes.

View file

@ -0,0 +1,13 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended-type-checked',
],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
},
ignorePatterns: ['.eslintrc.js'],
root: true,
};

View file

@ -1,15 +0,0 @@
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
],
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
ignorePatterns: [".eslintrc.js"],
root: true,
};

View file

@ -1,15 +1,6 @@
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
],
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
extends: ["@/build-config/eslintrc-typescript"],
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
ignorePatterns: [".eslintrc.js"],
root: true,
};

View file

@ -4,5 +4,5 @@ Like [@/utils](../utils/README.md), but for things that require React.
### Packaging
This (internal) package exports a vanilla TypeScript library. We rely on the
This (internal) package exports a React TypeScript library. We rely on the
importing project to transpile and bundle it.

View file

@ -1,15 +1,6 @@
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
],
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
extends: ["@/build-config/eslintrc-typescript"],
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
ignorePatterns: [".eslintrc.js"],
root: true,
};