-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
bug with options and double run #5
Comments
If you specify I think this is a feature; why do you think it’s a bug? |
@wooorm hm, as possible to run only lint? |
Yes, by either not specifying it in |
@wooorm good, but if i run |
I’m not yet sure what you’re saying, but it sounds like two questions. Could you show me what code you use, what goes wrong, and what you expect? |
'use strict';
var options = require('../options');
var taskConfig = options.get('tasks.remarkLint');
if (!taskConfig.enable) {
return;
}
var gulp = require('gulp');
var gulpPlumber = require('gulp-plumber');
var gulpRemark = require('gulp-remark');
var remarkLint = require('remark-lint');
var definingConfiguration = require('../lib/defining-configuration');
function remarkLintTask() {
var config = this.config;
return gulp
.src(config.paths.src.globs, config.paths.src.options)
.pipe(gulpPlumber(config.options.plumber))
.pipe(gulpRemark().use(remarkLint));
}
gulp.task('remarkLint', definingConfiguration(taskConfig, remarkLintTask));
module.exports = remarkLintTask; Run this task i run twice |
OK, I think this is gulp-remark related, not remark. I don’t know much about gulp. @denysdovhan, can you help here? |
@wooorm @denysdovhan and still I would like to know whether it is possible to run only lint? May be var gulpRemarkUse = require('gulp-remark').use; |
@evilebottnawi I can't understand too why you think about this as problem. Just use only This behavior is OK. It's like you've say twice what to do:
I think you didn't noticed that you can define options for |
@denysdovhan Ok twice it is normal. But define options (for plugins) in code it is not normal and uncomfortable. I work in big command and we created shared config for linting markdown in many own project - options in code it is not solution, it is strange. |
@evilebottnawi why? Don't you define options for postcss-plugins, for example? It's OK. If you don't like to define your settings in code, use |
@denysdovhan postcss-plugins not use .*rc files |
@denysdovhan we use eslint and have .eslintrc shared config for all projects, we use stylelint and have .stylelintrc shared config for all projects, it would be nice to have the same opportunity and the setting remark-lint. |
You can! Just remove the
|
@wooorm i need only linting, why run all plugins? My code may contain error and i can stop build on error. In big project i have many linter and first run linter before build. |
Also i use browserSync and pipe all changes. I need run linting on change code, i not need other plugins (not render html) |
@wooorm can |
@evilebottnawi If you don’t need other plug-ins, don’t use other plug-ins. This has nothing to do with your comments or your question. Look, you provided code twice: first a Now you’re talking about stuff which I haven’t seen code for, and which shouldn’t happen with the code you provided. @denysdovhan Yes, source. |
@wooorm ok i use and run linter once, but second use not get configuration from .remarkrc gulpRemark({detectRC: false}).use(gulpRemarkLint) I do not understand why you think it is convenient, but I will cite an example of using linters before build - standard workflow in many projects (incidentally |
@wooorm @denysdovhan why not create api: var gulpRemark = require('gulp-remark');
var gulpRemarkUse = require('gulp-remark').use; Where |
@evilebottnawi It seems you’re saying many different things, e.g., In your last comment, you’re proposing a mechanism where only one plug-in is run. I do not know of any other similar systems which allow that. Think Babel, which doesn’t allow running one plug-in, or PostCSS, which doesn’t allow just running one plug-in. Maybe you’re interested in gulp-remark-lint? |
@evilebottnawi if you want, you can use it like this: const gulpRemarkUse = require('gulp-remark')().use; And it will do what you need. |
@wooorm postcss plugins not use |
Then use |
@wooorm
All options for plugins are loaded use
Options not loaded for plugin from |
Don’t use plug-ins both in |
#5 (comment) about remark, not about gulp-remark. If you think this is strange, please open an issue there. Thank you for your question. I'm gonna close this issue, because the problem is solved. If you have any other question, please ask. |
.remarkrc
First use
remark()
use.remarkrc
and runlint
plugin, seconduse
double runlint
plugin, but not get config file.remarkrc
The text was updated successfully, but these errors were encountered: