@shgysk8zer0/stylelint-config
v1.0.1
Published
A standard config for Stylelint
Readme
@shgysk8zer0/stylelint-config
A standard config for Stylelint
Usage
Create a stylelint.config.js file in the root of your project and choose one of the following methods to apply the configuration.
1. Using the Default Config
To use the base configuration exactly as-is, re-export the default config object:
export { config as default } from '@shgysk8zer0/stylelint-config';
2. Modifying Rules with Exported Constants
If you prefer to manually construct your configuration object using the base standards, import the exported constants (RULES, IGNORE_FILES, PLUGINS) and spread them into your export:
import { RULES, IGNORE_FILES, PLUGINS } from '@shgysk8zer0/stylelint-config';
export default {
ignoreFiles: [...IGNORE_FILES, 'public/**/*.css'],
plugins: [...PLUGINS],
rules: {
...RULES,
'max-nesting-depth': 5, // Override a base rule
'block-no-empty': null // Disable a base rule
}
};3. Using getStyleLintConfig()
You can use the exported factory function to generate the configuration object. Any properties you pass in will automatically merge with the package defaults:
import { getStyleLintConfig } from '@shgysk8zer0/stylelint-config';
export default getStyleLintConfig({
ignoreFiles: ['public/**/*.css'], // Appends to the default IGNORE_FILES
rules: {
'max-nesting-depth': 5 // Overwrites this specific rule in the default RULES
}
});