lyonjs/shortvid.io

๐Ÿ’ก Eslint import rules

Boyadjie opened this issue ยท 0 comments

Feature Request ๐Ÿ‘จ๐Ÿผโ€๐Ÿ’ป

We want to fix our imports that are really messy

Use Case โœ๐Ÿผ

Better readability of the imports

Possible Solution ๐Ÿ’ก

  • Use the lib eslint-plugin-import to override the default eslint config for imports that isn't enough alone
  • Add config to organise imports, we can use this as a reference:

"import/order": [ "error", { "groups": ["builtin", "external", "internal"], "pathGroups": [ { "pattern": "react", "group": "external", "position": "before" } ], "pathGroupsExcludedImportTypes": ["react"], "newlines-between": "always", "alphabetize": { "order": "asc", "caseInsensitive": true } } ]

  • Run pnpm lint --fix to fix all the files following the rules