Add support for shorthands in `extends` and `plugins`
See original GitHub issueWhat is the problem you’re trying to solve?
Currently, we have to repeat the stylelint-config-
prefix over and over in the extends
field, the same for stylelint-plugin
in the plugins
field.
Similarly to ESLint, it would be nice to support the absence of the prefix, as in the following example:
Before:
module.exports = {
extends: ['stylelint-config-recommended', 'stylelint-config-prettier', 'stylelint-config-rational-order', @myorg/stylelint-config]
};
After:
module.exports = {
extends: ['recommended', 'prettier', 'rational-order', '@myorg'],
};
Not only this makes the config file more declarative, but it also encourages the community to publish their configs/plugins with the canonical name, and then this will leverage their packages (and the whole stylelint ecosystem) popularity.
What solution would you like to see?
I would like to see support for the following shorthands, adding a require.resolve
chain:
extends
:
stylelint-config-{config}
{org}/stylelint-config
{config}
plugins
:
stylelint-plugin-{plugin}
{org}/stylelint-plugin
{plugin}
I have implemented this same feature in Docusaurus, and I would be glad to port it to this repository too.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Shorthand Connect - Plugins - WordPress.org
This plugin provides a simple method for publishing and updating Shorthand stories directly inside of Wordpress.
Read more >Shorthand Drupal Plugins
To use the v4 plugin in a similar way to the previous plugins you will need to enable the "Shorthand Example" in the...
Read more >What is the difference between extends and plugins in ESLint ...
ESLint plugins allow you to add custom rules according to the needs of your project. Plugins are published as npm modules with names...
Read more >jsx-eslint/eslint-plugin-react: React-specific linting rules for ...
If you are using the new JSX transform from React 17, extend react/jsx-runtime in your eslint config (add "plugin:react/jsx-runtime" to "extends" ) to ......
Read more >Extending Prism
This section will help you write new language definitions, plugins and all-around Prism hacking.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s blog post is a great read.
It’s not, especially if we hope to migrate to a similar flat config system in the future.
As an aside, we’re close to a flat config system as an early design decision was not to implement cascading configs. I’m glad we made this decision.
From the blog post:
When I’ve finished reading ESLint’s blog post about its new config system, I start doubting if this issue’s flexible shorthand feature is really necessary. Because it seems to me that the increased complexity of our code base will be worse than improved usability through the new shorthand support.
What do you think regarding this opinion?