https://github.com/neworbit/stylelint-config
NewOrbit standard config for stylelint
https://github.com/neworbit/stylelint-config
hacktoberfest package
Last synced: 7 months ago
JSON representation
NewOrbit standard config for stylelint
- Host: GitHub
- URL: https://github.com/neworbit/stylelint-config
- Owner: NewOrbit
- License: mit
- Created: 2018-01-18T11:52:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-09-08T16:19:09.000Z (over 1 year ago)
- Last Synced: 2025-01-20T05:30:14.425Z (over 1 year ago)
- Topics: hacktoberfest, package
- Language: JavaScript
- Homepage:
- Size: 97.7 KB
- Stars: 1
- Watchers: 29
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# neworbit-stylelint-config
NewOrbit standard config for stylelint
## Usage
### Installation
`npm install neworbit-stylelint-config --save-dev`
### Setup
- Install peer dependencies
`npm install stylelint stylelint-config-standard-scss @stylistic/stylelint-config stylelint-scss stylelint-order stylelint-no-unsupported-browser-features --save-dev`
- Add `.stylelintrc.json` file with the following contents:
```json
{
"extends": "neworbit-stylelint-config"
}
```
- Add an npm script to run linter
```json
"lint:sass": "stylelint \"**/*.scss\""
```
### Integrate with webpack
You may want to integrate with webpack so that you get linting warnings on build. You may also want to consider failing on production build so linting errors block a pull request.
`npm install stylelint-webpack-plugin --save-dev`
```js
const StyleLintPlugin = require('stylelint-webpack-plugin');
const config = { /* webpack config */ };
let styleLintOptions = {
files: "**/*.scss"
};
if (process.env.NODE_ENV === "production") {
styleLintOptions.failOnError = true;
}
config.plugins.push(new StyleLintPlugin(styleLintOptions));
```
## Visual Studio Code
To make life better in Visual Studio Code when using stylelint install:
[VSCode Stylelint Plugin](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint)
## License
Made with :sparkling_heart: by [NewOrbit](https://www.neworbit.co.uk/) in Oxfordshire, and licensed under the [MIT License](LICENSE)