Conversation
…ove tests from ESLint
|
Everything's set for review, but should we include ...
typescript({ exclude: ["src/tests/**/*.ts"] })
// and
typescript({ exclude: ["src/tests"] })
// and
typescript({ exclude: ["src/tests/*.ts"] })
...None of the above options worked for me, please let me know if there's a way to do it I'm not thinking of |
package.json
Outdated
| "format": "prettier --write \"src/**/*.{ts,tsx}\"", | ||
| "format:ci": "prettier --list-different \"src/**/*.{ts,tsx}\"", |
There was a problem hiding this comment.
Let's format . instead of src to include package.json, eslint config etc. (which is currently improperly formatted)
Add a .prettierignore file so it excludes the docs folder.
eslint.config.mjs
Outdated
| tseslint.configs.recommended, | ||
| eslintConfigPrettierFlat, | ||
| { | ||
| files: ['**/*.ts*'], |
There was a problem hiding this comment.
scope to src/**/*.{ts,tsx}, this scans way too many files
There was a problem hiding this comment.
I disagree, since it runs on src in the command anyways, but I agree if anyone runs it without npm run lint, it would be painful
tsconfig.json
Outdated
| "rollup.config.js", | ||
| "src/tests", | ||
| "rollup.config.js" | ||
| ".prettierrc", |
There was a problem hiding this comment.
Shouldn't need this, it's not a JS/TS file
There was a problem hiding this comment.
Ah, sorry about that
I forgot to remove them when I was done testing for the src/tests bug I'm encountering
tsconfig.json
Outdated
| "src/tests", | ||
| "rollup.config.js" | ||
| ".prettierrc", | ||
| "eslint.config.mjs" |
There was a problem hiding this comment.
Oh I remember why, it's because Typescript threatened to overwrite them for some reason
I think it makes sense to just restrict Typescript to src, since no other Typescript files are present anywhere else in py-slang
tsconfig.json
Outdated
| "jest.config.js", | ||
| "node_modules", | ||
| "dist", | ||
| "rollup.config.js", |
There was a problem hiding this comment.
Ditto, why are we excluding it?
eslint.config.mjs
Outdated
| } | ||
| }, | ||
| { | ||
| files: ['**/*.js'], |
There was a problem hiding this comment.
Again, this is too huge. This also gives a subtle problem with code fragility because you are running tseslint on files like ESLint and Rollup config, but without the project service, so not all rules may be applicable (aka it just "happens to" work for this case, not "guaranteed" to work for all cases).
There was a problem hiding this comment.
I've restricted it to src/**/*.js (although for now, that's not gonna be used for a while) for now
Isn't the project service a typescript-eslint feature IIRC?
Hope this solves the issue, though!
package.json
Outdated
| "eslint": "^9.39.3", | ||
| "eslint-config-prettier": "^10.1.8", | ||
| "eslint-plugin-import": "^2.32.0", |
There was a problem hiding this comment.
Lint and format, etc, should all be devDependencies, not dependencies.
There was a problem hiding this comment.
Huh, I thought I used -D
Thanks for pointing it out!
Sorry, what do you mean?
|
No, they aren't because ...
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
},
},
...If I include the tests, it errors out with
The inclusion of |
…t not working on tests + Move linter + formatters to `devDependencies`
Nevermind, I think |
Solves issue #84
There are some manual type changes
and TODOs left for types who I've not yet moved from, such as movinganyValueback to a union ofNumberValue,StringValue, etc.