Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lint, workspace): Orderliness and break avoiding lint rules, package.json flags #1381

Merged
merged 20 commits into from
Nov 26, 2020

Conversation

Krisztiaan
Copy link
Contributor

@Krisztiaan Krisztiaan commented Oct 19, 2020

import/order: group and order imports to make imports easily scannable and deterministic
no-restricted-imports: warn about using src/* because typescript does not replace these paths so the imports will be any in the d.ts files

PARTIALLY Closes #1297

@Krisztiaan
Copy link
Contributor Author

Krisztiaan commented Oct 29, 2020

Something like typescript-transform-paths could also be used to avoid needing the src/* rule though.

package.json Outdated Show resolved Hide resolved
@peterp
Copy link
Contributor

peterp commented Oct 29, 2020

Something like typescript-transform-paths could also be used to avoid needing the src/* rule though.

Oooh, that's really cool - I really like the src/ alias, could we try this out?

@Krisztiaan
Copy link
Contributor Author

src is success, made some tuning on the import order, and extracted the eslint config from package.json. Moved scripts in package.json to start of file, as it's one of the most important things to overview when opening that file.

Added ttsc (not a typo!) that provides plugin capabilities to the typescript compiler. Needed for the src/* mapping.

@Krisztiaan Krisztiaan requested a review from peterp November 6, 2020 22:58
.vscode/settings.json Outdated Show resolved Hide resolved
@peterp
Copy link
Contributor

peterp commented Nov 24, 2020

Hey @Krisztiaan, I would love to get this merged, I've finally reviewed everything!

image

I tried to fix the merge conflicts, but I can't seem to get the tests to complete on my end. They're stalling infinitely.

@peterp
Copy link
Contributor

peterp commented Nov 24, 2020

Ah, I see the same tests are failing in the previous tests.

@peterp
Copy link
Contributor

peterp commented Nov 24, 2020

Damnit, I would love to merge this.

@github-actions
Copy link

github-actions bot commented Nov 25, 2020

@Krisztiaan Krisztiaan force-pushed the chore/import-nosrc-packagejson branch from 6208783 to d409887 Compare November 25, 2020 10:15
package.json Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@peterp peterp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@peterp peterp added this to the Next Release milestone Nov 26, 2020
@peterp peterp merged commit 895c2d0 into redwoodjs:main Nov 26, 2020
@Krisztiaan Krisztiaan deleted the chore/import-nosrc-packagejson branch November 26, 2020 18:28
@AntonioMeireles
Copy link
Contributor

late to the party, (sorry) - is there any good reason for the rules that were inside .eslintrc not to be in plain stock eslint-config so that rw projects would also consume them out of the box ?

@Krisztiaan
Copy link
Contributor Author

@AntonioMeireles probably me misunderstanding this

@AntonioMeireles
Copy link
Contributor

@Krisztiaan

actually you didn't 😄 - at the time it made sense. it's just that the 'no-restricted-imports'that was the culprit ended going away and the remaining bits imho are idiomatic and generic enough that they could just be shipped in eslint-config.

@Krisztiaan
Copy link
Contributor Author

That's what I mean by misunderstanding, I moved everything to project level instead of just the src rule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eslint-config: consider consuming "simple-import-sort" eslint plugin
4 participants