Replies: 4 comments 7 replies
-
Just out of curiosity, I added a check via eslint to the {
extends: ["eslint:recommended"],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint']
} The
I did it very clumsily and some tests that should have been skipped (using After looking at the results, I decided to analyze those tests where these rules were violated and share the results. no-undef, no-unused-vars no-constant-condition no-extra-semi no-const-assign no-redeclare no-cond-assign no-empty no-import-assign, no-unreachable, no-sparse-arrays, no-setter-return, no-useless-escape, no-debugger, no-unused-labels, no-mixed-spaces-and-tabs Of course, this is just a recommended set of rules from ESLint and there may be situations that are not described in the tests, but in my opinion, not much is needed to use Civet and ESLint together. For now it is enough to disable |
Beta Was this translation helpful? Give feedback.
-
We definitely need an |
Beta Was this translation helpful? Give feedback.
-
Related: is there a way to directly lint |
Beta Was this translation helpful? Give feedback.
-
I'm migrating to Biome now… How big an effort would it be to support Civet with a Biome 2.0 plugin? |
Beta Was this translation helpful? Give feedback.
-
Continuing the discussion started in #832
In my spare time, I look at ESLint rules for compatibility with Civet. So far, I have only looked through a few dozen, but it has already become clear that it may not be worth looking through all the rules to the end, even though this has its own benefits.
Most likely, the code that Civet produces does not satisfy only a few rules, and most likely, these are the rules from the Suggestions block. So my idea to write something like tests for each rule was, to put it mildly, not the smartest.
It seems to me that the code that can be passed into ESLint for testing is actually already written in Civet's own tests. After all, as far as I understand, there are potentially all the cases of code that Civet generates (excluding complex or missing cases). It's quite easy to write a script to check the code of all test cases for compliance with ESLint rules. In this way, a set of Civet rules for ESLint can be easily made, and those cases that do not allow full compatibility can be identified.
What do you think?
Regarding the empty catch block to support the corresponding ESLint rule, I looked at how to add a comment to it (discussed in issue #832) but decided not to do it for now, as it might be better done as part of the collective movement towards full ESLint support. After all, Civet generates empty blocks not only for the catch statement.
Beta Was this translation helpful? Give feedback.
All reactions