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

Adds option to disable Stylelint #78

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions config/general.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ const quiet = getArgumentValue('--quiet');
// analyzerPort
const analyzerPort = getArgumentValue('--port=') || 8888;

// disable Stylelint
const disableStyleLint = getArgumentValue('--disable-styelint');

// general webpack
const devtool = isProduction ? 'none' : 'inline-source-map';

Expand Down Expand Up @@ -105,6 +108,7 @@ module.exports = {
watch,
analyze,
analyzerPort,
disableStyleLint,
task,
quiet,
configFile,
Expand Down
10 changes: 10 additions & 0 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,13 @@ Analyze the bundles with [Webpack Bundle Analyzer](https://www.npmjs.com/package
"analyze": "nc-fe-build --task=webpack --analyze --development"
}
```

To change the port number, you can append the argument `--port=` followed by a valid port number.

# Additional Arguments
You can add the following arguments to the `nc-fe-build` command in order to change its behavior.

| Argument | Description |
| --------- | ----------- |
| `--quiet` | Displays less messages in the output |
| `--disable-styelint` | Disables Stylelint |
6 changes: 5 additions & 1 deletion utils/runStylelint.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ const linterError = require('./linterError');

module.exports = function runStylelint(files, projectConfig, cb) {
// extract from config
const { syntax, failOnError } = projectConfig.stylelint;
const { failOnError } = projectConfig.stylelint;
const { rootPath } = projectConfig.general;

if (projectConfig.general.disableStyleLint) {
return cb();
}

log(__filename, 'Stylelint');

stylelint.lint({
Expand Down