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

320-feat: add FSD eslint config #354

Merged
merged 8 commits into from
Jul 6, 2024
Merged

Conversation

Quiddlee
Copy link
Member

@Quiddlee Quiddlee commented Jun 30, 2024

What type of PR is this? (select all that apply)

  • πŸ• Feature
  • πŸ› Bug Fix
  • 🚧 Breaking Change
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ“ Documentation Update

Description

Related Tickets & Documents

Screenshots, Recordings

image

Added/updated tests?

  • πŸ‘Œ Yes
  • πŸ™…β€β™‚οΈ No, because they aren't needed
  • πŸ™‹β€β™‚οΈ No, because I need help

[optional] Are there any post deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

CatWibeGIF

Summary by CodeRabbit

  • Chores
    • Updated lint scripts to allow up to 400 warnings.
    • Added new ESLint configurations and dependencies for improved code quality checks.

@Quiddlee Quiddlee added feature New feature or request high priority labels Jun 30, 2024
@Quiddlee Quiddlee self-assigned this Jun 30, 2024
@Quiddlee Quiddlee requested a review from SpaNb4 June 30, 2024 10:29
Copy link
Contributor

coderabbitai bot commented Jun 30, 2024

Walkthrough

The update configures ESLint for Feature-Sliced Design (FSD) by importing FlatCompat, setting new configurations, and modifying import rules. It also adjusts the lint scripts in package.json to reflect a higher max-warnings threshold and includes the necessary dependencies to facilitate FSD rules.

Changes

File Change Summary
eslint.config.js Imported FlatCompat from @eslint/eslintrc, added configurations for fsdConfig and DIRNAME, and modified the 'import/no-internal-modules' rule.
package.json Updated lint and lint:fix scripts to change max-warnings from 10 to 400, and added @feature-sliced/eslint-config as a new devDependency.

Sequence Diagrams

No sequence diagrams are required as the changes are configuration updates and do not introduce new functional flows.

Assessment against linked issues

Objective Addressed Explanation
Setting up ESLint for Feature-Sliced Design (FSD) (#320) βœ…
Implementing a rule to restrict imports according to FSD rules (#320) βœ…
Ensuring all code passes the new ESLint rules without any errors (#320) ❓ It is unclear without running the linting process on the codebase.

Poem

πŸ‡βœ¨
In files where the code does play,
Linting rules now hold their sway.
With FSD's embrace, tidy and neat,
Errors conquered, a clean feat.
Code now shines, no warnings to stray,
Hip-hop hurray, for the ESLint way!
πŸ‡πŸŒŸ


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Quiddlee Quiddlee added the blocked For task blocked other tasks label Jun 30, 2024
Copy link

Lighthouse Report:

  • Performance: 86 / 100
  • Accessibility: 88 / 100
  • Best Practices: 93 / 100
  • SEO: 91 / 100

View detailed report

@Quiddlee Quiddlee marked this pull request as ready for review July 1, 2024 15:48
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@rolling-scopes rolling-scopes deleted a comment from github-actions bot Jul 3, 2024
@rolling-scopes rolling-scopes deleted a comment from github-actions bot Jul 3, 2024
Copy link

github-actions bot commented Jul 3, 2024

Qodana for JS

It seems all right πŸ‘Œ

No new problems were found according to the checks applied

πŸ’‘ Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Detected 266 dependencies

Third-party software list

This page lists the third-party software dependencies used in project

Dependency Version Licenses
@eslint-community/eslint-utils 4.4.0 MIT
@eslint-community/regexpp 4.11.0 MIT
@eslint/eslintrc 2.1.4 MIT
@eslint/js 8.57.0 MIT
@feature-sliced/eslint-config 0.1.1 MIT
@humanwhocodes/config-array 0.11.14 Apache-2.0
@humanwhocodes/module-importer 1.0.1 Apache-2.0
@humanwhocodes/object-schema 2.0.3 BSD-3-Clause
@next/env 14.2.4 MIT
@next/swc-linux-x64-gnu 14.2.4 MIT
@next/swc-linux-x64-musl 14.2.4 MIT
@nodelib/fs.scandir 2.1.5 MIT
@nodelib/fs.stat 2.0.5 MIT
@nodelib/fs.walk 1.2.8 MIT
@playwright/test 1.45.1 Apache-2.0
@remix-run/router 1.17.1 MIT
@swc/counter 0.1.3 Apache-2.0
@swc/helpers 0.5.5 Apache-2.0
@types/json5 0.0.29 MIT
@ungap/structured-clone 1.2.0 ISC
acorn-jsx 5.3.2 MIT
acorn 8.12.1 MIT
ajv 6.12.6 MIT
ansi-regex 5.0.1 MIT
ansi-styles 4.3.0 MIT
anymatch 3.1.3 ISC
array-buffer-byte-length 1.0.1 MIT
array-includes 3.1.8 MIT
array.prototype.findlastindex 1.2.5 MIT
array.prototype.flat 1.3.2 MIT
array.prototype.flatmap 1.3.2 MIT
arraybuffer.prototype.slice 1.0.3 MIT
available-typed-arrays 1.0.7 MIT
balanced-match 1.0.2 MIT
binary-extensions 2.3.0 MIT
brace-expansion 1.1.11 MIT
braces 3.0.3 MIT
brcast 3.0.2 MIT
busboy 1.6.0 MIT
call-bind 1.0.7 MIT
callsites 3.1.0 MIT
caniuse-lite 1.0.30001640 CC-BY-4.0
chalk 4.1.2 MIT
chokidar 3.6.0 MIT
class-variance-authority 0.7.0 Apache-2.0
classnames 2.5.1 MIT
client-only 0.0.1 MIT
clsx 2.0.0 MIT
color-convert 2.0.1 MIT
color-name 1.1.4 MIT
concat-map 0.0.1 MIT
cross-spawn 7.0.3 MIT
css-vendor 0.3.8 MIT
data-view-buffer 1.0.1 MIT
data-view-byte-length 1.0.1 MIT
data-view-byte-offset 1.0.0 MIT
dayjs 1.11.11 MIT
debug 3.2.7 MIT
debug 4.3.5 MIT
deep-is 0.1.4 MIT
define-data-property 1.1.4 MIT
define-properties 1.2.1 MIT
doctrine 2.1.0 Apache-2.0
doctrine 3.0.0 Apache-2.0
es-abstract 1.23.3 MIT
es-define-property 1.0.0 MIT
es-errors 1.3.0 MIT
es-object-atoms 1.0.0 MIT
es-set-tostringtag 2.0.3 MIT
es-shim-unscopables 1.0.2 MIT
es-to-primitive 1.2.1 MIT
escape-string-regexp 4.0.0 MIT
eslint-import-resolver-node 0.3.9 MIT
eslint-module-utils 2.8.1 MIT
eslint-plugin-boundaries 4.2.1 MIT
eslint-plugin-import 2.29.1 MIT
eslint-scope 7.2.2 BSD-2-Clause
eslint-visitor-keys 3.4.3 Apache-2.0
eslint 8.57.0 MIT
espree 9.6.1 BSD-2-Clause
esquery 1.5.0 BSD-3-Clause
esrecurse 4.3.0 BSD-2-Clause
estraverse 5.3.0 BSD-2-Clause
esutils 2.0.3 BSD-2-Clause
fast-deep-equal 3.1.3 MIT
fast-levenshtein 2.0.6 MIT
fastq 1.17.1 ISC
file-entry-cache 6.0.1 MIT
fill-range 7.1.1 MIT
find-up 5.0.0 MIT
flat-cache 3.2.0 MIT
flatted 3.3.1 ISC
for-each 0.3.3 MIT
fs.realpath 1.0.0 ISC
function-bind 1.1.2 MIT
function.prototype.name 1.1.6 MIT
functions-have-names 1.2.3 MIT
get-intrinsic 1.2.4 MIT
get-symbol-description 1.0.2 MIT
glob-parent 5.1.2 ISC
glob-parent 6.0.2 ISC
glob 7.2.3 ISC
globals 13.24.0 MIT
globalthis 1.0.4 MIT
gopd 1.0.1 MIT
graceful-fs 4.2.11 ISC
graphemer 1.4.0 MIT
has-bigints 1.0.2 MIT
has-property-descriptors 1.0.2 MIT
has-proto 1.0.3 MIT
has-symbols 1.0.3 MIT
has-tostringtag 1.0.2 MIT
hasown 2.0.2 MIT
hoist-non-react-statics 2.5.5 BSD-3-Clause
hyphenate-style-name 1.1.0 BSD-3-Clause
ignore 5.3.1 MIT
immutable 4.3.6 MIT
import-fresh 3.3.0 MIT
imurmurhash 0.1.4 MIT
inflight 1.0.6 ISC
inherits 2.0.4 ISC
internal-slot 1.0.7 MIT
is-array-buffer 3.0.4 MIT
is-bigint 1.0.4 MIT
is-binary-path 2.1.0 MIT
is-boolean-object 1.1.2 MIT
is-callable 1.2.7 MIT
is-core-module 2.13.1 MIT
is-core-module 2.14.0 MIT
is-data-view 1.0.1 MIT
is-date-object 1.0.5 MIT
is-extglob 2.1.1 MIT
is-function 1.0.2 MIT
is-glob 4.0.3 MIT
is-in-browser 1.1.3 MIT
is-negative-zero 2.0.3 MIT
is-number-object 1.0.7 MIT
is-number 7.0.0 MIT
is-path-inside 3.0.3 MIT
is-plain-object 2.0.4 MIT
is-regex 1.1.4 MIT
is-shared-array-buffer 1.0.3 MIT
is-string 1.0.7 MIT
is-symbol 1.0.4 MIT
is-typed-array 1.1.13 MIT
is-weakref 1.0.2 MIT
isarray 2.0.5 MIT
isexe 2.0.0 ISC
isobject 3.0.1 MIT
js-tokens 4.0.0 MIT
js-yaml 4.1.0 MIT
json-buffer 3.0.1 MIT
json-stable-stringify-without-jsonify 1.0.1 MIT
json5 1.0.2 MIT
jss-camel-case 6.1.0 MIT
jss-compose 5.0.0 MIT
jss-default-unit 8.0.2 MIT
jss-expand 5.3.0 MIT
jss-extend 6.2.0 MIT
jss-global 3.0.0 MIT
jss-nested 6.0.1 MIT
jss-preset-default 4.5.0 MIT
jss-props-sort 6.0.0 MIT
jss-template 1.0.1 MIT
jss-vendor-prefixer 7.0.0 MIT
jss 9.8.7 MIT
keyv 4.5.4 MIT
levn 0.4.1 MIT
locate-path 6.0.0 MIT
lodash.merge 4.6.2 MIT
loose-envify 1.4.0 MIT
micromatch 4.0.5 MIT
minimatch 3.1.2 ISC
minimist 1.2.8 MIT
ms 2.1.2 MIT
nanoid 3.3.7 MIT
natural-compare 1.4.0 MIT
next 14.2.4 MIT
nextjs-toploader 1.6.12 MIT
normalize-path 3.0.0 MIT
nprogress 0.2.0 MIT
object-assign 4.1.1 MIT
object-inspect 1.13.2 MIT
object-keys 1.1.1 MIT
object.assign 4.1.5 MIT
object.fromentries 2.0.8 MIT
object.groupby 1.0.3 MIT
object.values 1.2.0 MIT
once 1.4.0 ISC
optionator 0.9.4 MIT
p-limit 3.1.0 MIT
p-locate 5.0.0 MIT
parent-module 1.0.1 MIT
path-exists 4.0.0 MIT
path-is-absolute 1.0.1 MIT
path-key 3.1.1 MIT
path-parse 1.0.7 MIT
picocolors 1.0.1 ISC
picomatch 2.3.1 MIT
playwright-core 1.45.1 Apache-2.0
playwright 1.45.1 Apache-2.0
possible-typed-array-names 1.0.0 MIT
postcss 8.4.31 MIT
prelude-ls 1.2.1 MIT
prop-types 15.8.1 MIT
queue-microtask 1.2.3 MIT
react-dom 16.14.0 MIT
react-dom 18.3.1 MIT
react-double-marquee 1.1.0 MIT
react-easy-swipe 0.0.21 MIT
react-is 16.13.1 MIT
react-json-pretty 2.2.0 MIT
react-jss 8.6.1 MIT
react-responsive-carousel 3.2.23 MIT
react-router-dom 6.24.1 MIT
react-router 6.24.1 MIT
react 16.14.0 MIT
react 18.3.1 MIT
readdirp 3.6.0 MIT
regexp.prototype.flags 1.5.2 MIT
resolve-from 4.0.0 MIT
resolve 1.22.8 MIT
reusify 1.0.4 MIT
rimraf 3.0.2 ISC
run-parallel 1.2.0 MIT
safe-array-concat 1.1.2 MIT
safe-regex-test 1.0.3 MIT
sass 1.77.6 MIT
scheduler 0.19.1 MIT
scheduler 0.23.2 MIT
semver 6.3.1 ISC
set-function-length 1.2.2 MIT
set-function-name 2.0.2 MIT
shebang-command 2.0.0 MIT
shebang-regex 3.0.0 MIT
side-channel 1.0.6 MIT
source-map-js 1.2.0 BSD-3-Clause
streamsearch 1.1.0 MIT
string.prototype.trim 1.2.9 MIT
string.prototype.trimend 1.0.8 MIT
string.prototype.trimstart 1.0.8 MIT
strip-ansi 6.0.1 MIT
strip-bom 3.0.0 MIT
strip-json-comments 3.1.1 MIT
styled-jsx 5.1.1 MIT
supports-color 7.2.0 MIT
supports-preserve-symlinks-flag 1.0.0 MIT
text-table 0.2.0 MIT
theming 1.3.0 MIT
to-regex-range 5.0.1 MIT
tsconfig-paths 3.15.0 MIT
tslib 2.6.3 0BSD
type-check 0.4.0 MIT
type-fest 0.20.2 MIT
typed-array-buffer 1.0.2 MIT
typed-array-byte-length 1.0.1 MIT
typed-array-byte-offset 1.0.2 MIT
typed-array-length 1.0.6 MIT
unbox-primitive 1.0.2 MIT
warning 3.0.0 BSD-3-Clause
which-boxed-primitive 1.0.2 MIT
which-typed-array 1.1.15 MIT
which 2.0.2 ISC
word-wrap 1.2.5 MIT
wrappy 1.0.2 ISC
yocto-queue 0.1.0 MIT
Contact Qodana team

Contact us at [email protected]

@Quiddlee Quiddlee removed the blocked For task blocked other tasks label Jul 3, 2024
package.json Outdated Show resolved Hide resolved
@ansivgit ansivgit self-requested a review July 4, 2024 04:50
Copy link
Collaborator

@NikitaStarmoussov NikitaStarmoussov left a comment

Choose a reason for hiding this comment

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

I checked:

  1. Import order
  2. public api
  3. import from one layer

What else needs to be checked?

Copy link
Collaborator

@NikitaStarmoussov NikitaStarmoussov left a comment

Choose a reason for hiding this comment

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

Maybe the rules can be connected only for shared folder?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 09d9b2b and 27eae06.

Files selected for processing (1)
  • package.json (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • package.json

@Quiddlee
Copy link
Member Author

Quiddlee commented Jul 5, 2024

Maybe the rules can be connected only for shared folder?

This is too complex, because my rules will overlap config rules, therefore i need to rewrite all the rules by myself considering that only shared folder needs to be linted.

Let's stick with what we have right now, i'm watching closely for the FSD team new linter for stable release, so we probably gonna migrate to it anytime soon.

https://www.npmjs.com/package/steiger

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 27eae06 and b0f3fd2.

Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
Files selected for processing (2)
  • eslint.config.js (5 hunks)
  • package.json (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • eslint.config.js
  • package.json

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b0f3fd2 and 22ea83e.

Files selected for processing (1)
  • package.json (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • package.json

@NikitaStarmoussov NikitaStarmoussov dismissed their stale review July 6, 2024 12:03

Not possible to complete

@Quiddlee Quiddlee merged commit 82f25bb into main Jul 6, 2024
6 checks passed
@Quiddlee Quiddlee deleted the feat/320-set-up-eslint-for-fsd branch July 6, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting up ESLint for Feature-Sliced Design.
5 participants