UNPKG

@bitfactory/stylelint-config

Version:
105 lines (84 loc) 1.69 kB
# CLI Usage > [!NOTE] > When using Docker with `[p]npm` Make recipes add `make` before every command, and surround instruction with quotes. ## NPM Scripts To use Stylelint in the command-line, add the following scripts to your projects `package.json`: ### Basic CSS ```json { "scripts": { "stylelint": "stylelint 'path/to/your/assets/**/*.css'", "stylelint:fix": "pnpm run stylelint --fix" } } ``` ```json { "scripts": { "stylelint": "stylelint 'path/to/your/assets/**/*.css'", "stylelint:fix": "npm run stylelint -- --fix" } } ``` ### SCSS files ```json { "scripts": { "stylelint": "stylelint 'path/to/your/assets/**/*.scss'", "stylelint:fix": "pnpm run stylelint --fix" } } ``` ```json { "scripts": { "stylelint": "stylelint 'path/to/your/assets/**/*.scss'", "stylelint:fix": "npm run stylelint -- --fix" } } ``` ### Vue.js files ```json { "scripts": { "stylelint": "stylelint 'path/to/your/assets/**/*.vue'", "stylelint:fix": "pnpm run stylelint --fix" } } ``` ```json { "scripts": { "stylelint": "stylelint 'path/to/your/assets/**/*.vue'", "stylelint:fix": "npm run stylelint -- --fix" } } ``` ### All files (let config decide) ```json { "scripts": { "stylelint": "stylelint .", "stylelint:fix": "pnpm run stylelint --fix" } } ``` ```json { "scripts": { "stylelint": "stylelint .", "stylelint:fix": "npm run stylelint -- --fix" } } ``` ## Running Commands You can run the commands with: ```bash pnpm run stylelint pnpm run stylelint:fix ``` ```bash npm run stylelint npm run stylelint:fix ``` > With PNPM you can also run scripts without 'run' like `pnpm stylelint`.