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

[eslint-plugin] adding new options to strict-component-boundaries #150

Merged

Conversation

patsissons
Copy link
Contributor

@patsissons patsissons commented Apr 30, 2020

adding the following options to strict-component-boundaries lint rule

  • allow (string[]): list of patterns to automatically allow (i.e., ['section/Foo/.*'])
  • maxDepth (number): max allowed inclusive depth for components boundary (default is 1)
    • components would be depth 1 since there is a single inclusive components level
    • components/Foo would be depth 2
    • sections/Foo/components/Bar/Baz would be depth 3

@patsissons patsissons force-pushed the eslint-plugin/strict-component-boundaries-options branch from f0eeff6 to c07a2fc Compare May 1, 2020 00:52
@patsissons patsissons marked this pull request as ready for review May 1, 2020 00:56
Copy link
Contributor

@marutypes marutypes left a comment

Choose a reason for hiding this comment

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

🎉

@alexandcote
Copy link
Contributor

Do you know if the regex can match the absolute path?

Let say we want to allow:

sections/Editor/components/Foo

Should we also allow :

../components/Foo

Maybe you already handle this? 🤔

@patsissons
Copy link
Contributor Author

patsissons commented May 5, 2020

Do you know if the regex can match the absolute path?

Let say we want to allow:

sections/Editor/components/Foo

Should we also allow :

../components/Foo

Maybe you already handle this? 🤔

we should be able to handle this via

options: [{allow: [
  // relative support
  '\.\./(?:.*/)?components/\\w+$',

  // absolute support
  '^sections/.*/components/\\w+$',
]}],

@patsissons patsissons merged commit f567cc9 into master May 5, 2020
@patsissons patsissons temporarily deployed to production May 5, 2020 16:42 Inactive
@alexandcote alexandcote deployed to packages-bump May 17, 2020 00:06 Active
@alexandcote alexandcote deployed to bump_postcss_deps May 20, 2020 12:40 Active
@antoinegrant antoinegrant temporarily deployed to production July 7, 2020 16:54 Inactive
@alexandcote alexandcote deleted the eslint-plugin/strict-component-boundaries-options branch September 11, 2020 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants