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

Add empty create function to deprecated rules #584

Merged
merged 4 commits into from Mar 8, 2020

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Mar 8, 2020

Not sure how it works, but seems create is required. https://github.com/fisker/shared-configs/pull/865/checks?check_run_id=493628377#step:5:14

TypeError: Error while loading rule 'unicorn/regex-shorthand': rule.create is not a function

@sindresorhus
Copy link
Owner

Tests are failing

@fisker
Copy link
Collaborator Author

fisker commented Mar 8, 2020

@sindresorhus It should return an empty object, I fixed it.

But another strange thing came up,

If I use

module.exports = {
	create: () => ({})
};

eslint-plugin/require-meta-schema eslint-plugin/require-meta-docs-description eslint-plugin/require-meta-docs-url are failing.

I notice this before, seems those rules are not working on our other rules file.

This might be a eslint-plugin-eslint-plugin bug.

@fisker fisker changed the title Add empty create function to deprecate rules Add empty create function to deprecated rules Mar 8, 2020
@sindresorhus sindresorhus merged commit fe8f336 into sindresorhus:master Mar 8, 2020
@fisker fisker deleted the empty-create branch March 8, 2020 18:12
@fisker
Copy link
Collaborator Author

fisker commented Mar 8, 2020

@sindresorhus Can you exclude rules/.DS_Store file on next release?

https://unpkg.com/browse/eslint-plugin-unicorn@17.0.0/rules/

@sindresorhus
Copy link
Owner

npm should do that automatically, so if it doesn't, it's a bug in npm. I remember this being a bug some years ago, so I guess it's come back... I'm using npm v6.14.0.

@fisker
Copy link
Collaborator Author

fisker commented Mar 8, 2020

Indeed

npm/cli#440
https://npm.community/t/831

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.

None yet

2 participants