[internal] Lint with typescript-eslint parser#21758
[internal] Lint with typescript-eslint parser#21758oliviertassinari merged 16 commits intomui:nextfrom
Conversation
5f39f8b to
935ebfb
Compare
|
Heads up: We recently bumped |
935ebfb to
7243c5d
Compare
7243c5d to
29f9613
Compare
faf0c05 to
5079f88
Compare
I have rebased, no change in the configuration was required :). |
| extends: [ | ||
| 'plugin:import/recommended', | ||
| 'plugin:import/typescript', | ||
| 'airbnb-typescript', |
There was a problem hiding this comment.
What the motivation of usage predefined config? Why not to use recommended by @tpescript-eslint?
There was a problem hiding this comment.
One of the end goal is to avoid developers or have to format the code once they copy and paste it from the demos. So the question we should answer to is: what's more popular in the community? Also, we have to consider that the stricter rules also cover lesser rules, meaning we can cover more developers by being more strict than the average.
The second goal is to make us more productive.
There was a problem hiding this comment.
Note that we were already using the Airbnb configuration. My objective was to lint TypeScript minimizing the diff. If we want to change the rules, that would be best in a different pull request.
There was a problem hiding this comment.
We can discuss the preset in another issue. This PR should be limited to switching the parser and adding TS files.
eps1lon
left a comment
There was a problem hiding this comment.
Might've repeated myself but there's a lot to go through here. Big thanks to working on this 👍
| extends: [ | ||
| 'plugin:import/recommended', | ||
| 'plugin:import/typescript', | ||
| 'airbnb-typescript', |
There was a problem hiding this comment.
We can discuss the preset in another issue. This PR should be limited to switching the parser and adding TS files.
.eslintrc.js
Outdated
| */ | ||
| // Sorted alphanumerically | ||
| rules: { | ||
| '@typescript-eslint/dot-notation': 'off', // Too slow |
There was a problem hiding this comment.
If you enable the rules that are disabled with // Too slow, you will timeout the CI. No answers after 10 minutes. It seems to get stuck. I haven't looked at why.
f3027d3 to
fe2a906
Compare
I have tried to take as many feedback as possible into account
Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com>
40bab50 to
f34e233
Compare
| 'react/destructuring-assignment': 'off', // It's fine. | ||
| 'react/forbid-prop-types': 'off', // Too strict, no time for that | ||
| 'react/jsx-curly-brace-presence': 'off', // broken | ||
| 'react/jsx-filename-extension': ['error', { extensions: ['.js', '.tsx'] }], // airbnb is using .jsx |
There was a problem hiding this comment.
If you don't care about restricting the file extensions that may contain JSX.
-- https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
There was a problem hiding this comment.
.jsx isn't allowed, influenced by airbnb/javascript#985 (comment)
Follow-up on mui#21758 (comment)
This effort is part of a unification of the infrastructure that supports the authoring of outstanding React components for Material-UI between the main repository, the enterprise repository (written in TypeScript) and the pickers repository (written in TypeScript) that will likely be split between the main one for the MIT components and the x one for the enterprise features (#19706).
The objective is to find a configuration that works in the environment that sets the highest constraints (here) to then be able to copy and paste (until we find something better) the configuration to: