settingsログイン
メニュー

【解決済み】stylelintの記述をgulp.jsから外すとうまくいくのですが、stylelintの記述を入れるとError: No configuration foundとエラーが出ます。

閲覧 1,220
stylelintの記述をgulp.jsから外すとうまくいくのですが、stylelintの記述を入れるとError: No configuration foundとエラーが出ます。
どなたか理由がわかりませんでしょうか?
stylelintの記述を外すとうまくいきます。

・stylelintインストール時

C:\Users\user\Desktop\images\gulp-folder\postcss>npm install --save-dev npm install stylelint
npm WARN prefer global npm@3.9.6 should be installed with -g
npm WARN prefer global colorguard@1.2.0 should be installed with -g
postcss@1.0.0 C:\Users\user\Desktop\images\gulp-folder\postcss
+-- install@0.8.1
+-- npm@3.9.6
| +-- abbrev@1.0.7
| +-- ansi-regex@2.0.0
| +-- ansicolors@0.3.2
| +-- ansistyles@0.1.3
| +-- aproba@1.0.3
| +-- archy@1.0.0
| +-- chownr@1.0.1
| +-- cmd-shim@2.0.2
| +-- columnify@1.5.4
| | `-- wcwidth@1.0.0
| |   `-- defaults@1.0.3
| |     `-- clone@1.0.2
| +-- config-chain@1.1.10
| | `-- proto-list@1.2.4
| +-- debuglog@1.0.1
| +-- dezalgo@1.0.3
| | `-- asap@2.0.3
| +-- editor@1.0.0
| +-- fs-vacuum@1.2.9
| +-- fs-write-stream-atomic@1.0.8
| +-- fstream@1.0.8
| +-- fstream-npm@1.1.0
| | `-- fstream-ignore@1.0.5
| |   `-- minimatch@3.0.0
| |     `-- brace-expansion@1.1.4
| |       +-- balanced-match@0.4.1
| |       `-- concat-map@0.0.1

npm WARN postcss@1.0.0 No description
npm WARN postcss@1.0.0 No repository field.

・トランスパイル時

C:\Users\user\Desktop\images\gulp-folder\postcss>gulp css
(node:4856) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[13:20:27] Using gulpfile ~\Desktop\images\gulp-folder\postcss\gulpfile.js
[13:20:27] Starting 'css'...

events.js:160
      throw er; // Unhandled 'error' event
      ^
 Error: No configuration found
    at exports.default (C:\Users\user\Desktop\images\gulp-folder\postcss\node_modules\stylelint\dist\utils\configurationError.js:8:13)
    at C:\Users\user\Desktop\images\gulp-folder\postcss\node_modules\stylelint\dist\buildConfig.js:43:54

・gulpfile.js

//gulpfile.js
var gulp = require('gulp');              //gulpをインポート
var postcss = require('gulp-postcss');   //gulp-postcssをインポート
var cssnext = require('postcss-cssnext'); //cssnextをインポート
var nested = require('postcss-nested');
var stylelint = require('stylelint');

gulp.task('css', function () {           //”css”タスクを登録
  var plugins = [  
  cssnext,                      //一旦空の配列を作成
  nested,
  stylelint
  ];
  return gulp.src('./src-before/*.css')         //src-before下にある.cssファイルを指定
    .pipe(postcss(plugins))              //PostCSSにファイルを処理してもらう
    .pipe(gulp.dest('./dest-after'));          //生成されたCSSをdest-after下に配置
});
nobunaga 2016 6/19 質問 開発ツール

回答 1

役立ち 0
 
ベストアンサー!

こんにちは

No configuration foundとは、設定ファイルが見つからないという事ですので、http://stylelint.io/より Getting started の2番 Create your configuration object  の部分の設定ファイルの生成の項をお読みになられて設定される事をお勧めいたします

ちなみにstylelintの一般的な設定ファイルは下記よりダウンロード可能です

https://github.com/stylelint/stylelint-config-standard/blob/master/index.js

e-Systems 東京都 中央区 システム構築・ソフトウェア開発

全ての回答 ホームページへ
2016 6/19 回答
ただnmpコマンドでインストールして使えるというわけではないのですね。

プログラミング・開発言語、開発ツール の企業/事業者/教室/プロの方のホームページの集客、アクセスアップ、SEO対策効果が期待できるリスティングサイト=Ask-itをぜひご活用ください

Ask IT にようこそ。ここではコミュニティメンバーに質問したり、回答を得ることができます。
ITについて質問したい方へ ITについてプロに質問したい方は会員登録後すぐに質問をする事ができます。

プロフェッショナルの方へ 質問に答えていただけるプロフェッショナルの方は下記をご覧下さい

お気づきの点があれば是非お知らせください
...