Conversation
| '@typescript-eslint/no-empty-function': 'off', | ||
| 'no-shadow': 'warn', | ||
| 'prettier/prettier': 'error', | ||
| 'no-shadow': 'error', |
There was a problem hiding this comment.
The real win here. This can be a pretty nasty/hard-to-spot bug, and I’m a big fan of this lint rule.
| @@ -0,0 +1 @@ | |||
| src/parser/parse/**/*.ts | |||
There was a problem hiding this comment.
I just disabled linting for code we didn‘t write 🤷🏻
|
|
||
| const defn = components[componentName]; | ||
| const fileUrl = new URL(defn.specifier, filename); | ||
| const fileUrl = new URL(defn.specifier, importUrl); |
| for (const match of matches.reverse()) { | ||
| const name = match[1]; | ||
| appendImports(name, filename, astroConfig); | ||
| for (const foundImport of matches.reverse()) { |
| } | ||
| for (const match of matches.reverse()) { | ||
| const name = match[1]; | ||
| for (const astroComponent of matches.reverse()) { |
| if (!lastValue) continue; | ||
| selectors.push({ start, end: isEnd ? n + 1 : n, value: lastValue }); | ||
| start = n + 1; | ||
| { |
| function formatErrorForBrowser(err: Error) { | ||
| // TODO make this pretty. | ||
| return error.toString(); | ||
| return err.toString(); |
There was a problem hiding this comment.
This was a pretty good find for no-shadow! We had a param with the same name as a function.
|
Yea, I don't know if I'm fully on board with "any is always a lint error/warning". For example, I've been pulling my hair out trying to type the AST walking enter/exit functions. But, if everyones on board with things like |
|
Just disabled the |
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Changes
Enforces the
"no-shadow": "error"rule, and also adds several missing JSDoc comments.You‘ll notice there are still a lot of
anywarnings in the code. This is where we can negotiate whether or not this is helpful. If it helps us pay down debt (I’ve personally always found a way aroundany, except in the case of external libraries), let‘s keep it, but if not, let’s ditch it.The goal is to improve code quality. Which should annoy us a little bit, but shouldn‘t just be noise, either.
Testing
Docs