Skip to content

Testing: Remove custom ESLint rules for import paths#13937

Merged
gziolo merged 1 commit intomasterfrom
remove/eslintrc-import-path
Feb 19, 2019
Merged

Testing: Remove custom ESLint rules for import paths#13937
gziolo merged 1 commit intomasterfrom
remove/eslintrc-import-path

Conversation

@aduth
Copy link
Copy Markdown
Member

@aduth aduth commented Feb 18, 2019

Previously: #3531, #3533

This pull request seeks to remove custom ESLint rules which were implemented at a time where the package pattern was first being introduced. Previously, attempting to import from 'element' instead of from '@wordpress/element' would work, but bloat bundle sizes in the process. These days, however, the former import statement simply does not work (a build error will occur).

By removing these custom ESLint rules, we avoid one additional step required when adding new packages. Notably, these rules don't encompass all current packages anyways.

Testing instructions:

Verify that changing any import to remove @wordpress/ prefix does not build.

@aduth aduth added [Type] Build Tooling Issues or PRs related to build tooling [Type] Code Quality Issues or PRs that relate to code quality labels Feb 18, 2019
@aduth aduth requested review from gziolo and mcsf February 18, 2019 21:23
@aduth aduth mentioned this pull request Feb 18, 2019
5 tasks
Copy link
Copy Markdown
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Yes, it makes a lot of sense now given that you would have to use very weird syntax like:
`import Button from '../../../components/src/button'

We still use it for mocks in tests though... However, it's an exception which was meant to be temporary 😅

Anyway, I think that we can remove those ESLint rules.

@gziolo gziolo added this to the 5.2 (Gutenberg) milestone Feb 19, 2019
@gziolo gziolo merged commit 4f0081b into master Feb 19, 2019
@gziolo gziolo deleted the remove/eslintrc-import-path branch February 19, 2019 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants