Файл конфигурации gulp-scss-lint не проверяет файл scss и показывает предупреждение - PullRequest
2 голосов
/ 13 мая 2019

Я установил node, gulp в локальной системе и пытаюсь использовать css lint с помощью gulp.Ниже приведен мой код.

файл common.scss

dd {
    margin: 0;
}

gulp / config.js

scss: {
    source: '/web/assets/scss/**/*.scss',
    destination: '/web/assets/css',
    options: {
        outputStyle: 'compressed'   
    },

    linting: {
        config: path.resolve(__dirname, '.scss-lint.yml')
    }
},

.scss-lint.yml file

# Default application configuration that all configurations inherit from.

scss_files: "**/*.scss"
plugin_directories: ['.scss-linters']

# List of gem names to load custom linters from (make sure they are already
# installed)
plugin_gems: []

# Default severity of all linters.
severity: warning

linters:
    Indentation:
        enabled: true
        allow_non_nested_indentation: false
        character: space # or 'tab'
        width: 2

scss.js file

const application = require('../application'),
    autoprefixer = require('gulp-autoprefixer'),
    csso = require('gulp-csso'),
    gulp = require('gulp'),
    gulpif = require('gulp-if'),
    linter = require('gulp-scss-lint'),
    scss = require('gulp-sass'),
    sourcemaps = require('gulp-sourcemaps');

const linterOptions = application.config().scss.linting;
linterOptions.config = application.path(linterOptions.config);

console.log("----------------------------------");
console.log(application.config().scss.source);
console.log("----------------------------------");

module.exports = function() {
    return gulp.src(application.path(application.config().scss.source))
        .pipe(linter({'maxBuffer': 9999999 * 1024}))
        .pipe(linter(linterOptions))
        .pipe(gulpif(application.mode() === 'development' && !application.isWatchTask(), linter.failReporter()))
        .pipe(gulpif(application.mode() === 'development', sourcemaps.init()))
        .pipe(scss(application.config().scss.options))
        .on('error', scss.logError)
        .pipe(gulpif(application.mode() === 'development', sourcemaps.write()))
        .pipe(gulpif(application.mode() === 'production', autoprefixer(application.config().autoprefixer)))
        .pipe(gulpif(application.mode() === 'production', csso()))
        .pipe(gulp.dest(application.path(application.config().scss.destination)))
        .pipe(application.browserSyncInstance().stream());
};

Когда я запускаю команду "gulp scss"это показывает ниже ошибку:

[14:51:51] 1 issues found in /var/www/html/limited/vendor/freewheel/freewheel-theme/web/assets/scss/common.scss
[14:51:51] common.scss:3 [W] Indentation: Line should be indented with spaces, not tabs
(node:22150) Warning: a promise was created in a handler at var/www/html/limited/node_modules/gulp-scss-lint/src/index.js:30:18 but was not returned from it 
    at new Promise (/var/www/html/limited/node_modules/bluebird/js/release/promise.js:79:10)
[14:51:51] 1 issues found in /var/www/html/limited/vendor/freewheel/freewheel-theme/web/assets/scss/common.scss
[14:51:51] common.scss:3 [W] Indentation: Line should be indented with spaces, not tabs
Fatal Error in plugin "gulp-scss-lint"
Message:
    Error in plugin "gulp-scss-lint"
Message:
    ScssLint failed for: common.scss
...