coc-stylelintplus icon indicating copy to clipboard operation
coc-stylelintplus copied to clipboard

Not working coc-stylelintplus in neovim

Open mr-scrpt opened this issue 1 year ago • 6 comments

Hi all. My coc-stylelintplus is not working.Please help me find the cause Here are my configs:

coc-settings.json

{
  "stylelintplus.enable": true,
  "stylelintplus.filetypes": [
    "css",
    "less",
    "postcss",
    "sass",
    "scss",
    "sugarss",
    "vue"
  ],
  "stylelintplus.validateOnSave": true,
  "stylelintplus.validateOnType": true,
  "css.validate": false,
  "less.validate": false,
  "scss.validate": false,
  "eslint.autoFixOnSave": true,
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ],
  "eslint.probe": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ],
  "coc.preferences.formatOnSave": true,
  "emmet.includeLanguages": {
    "htmldjango": "html",
    "njk": "html",
    "nunjucks": "html",
    "html": "njk"
  }
}

coc.lua

vim.g.coc_global_extensions =  { 
    'coc-tag', 
    'coc-css',
    'coc-htmldjango',
    'coc-html', 
    'coc-json', 
    'coc-prettier', 
    'coc-vimlsp', 
    'coc-pairs', 
    'coc-eslint', 
    'coc-tsserver', 
    'coc-emmet', 
    'coc-stylelintplus'
} 

vim.cmd(" let g:coc_user_config = { 'suggest.enablePreview': v:true,  'prettier.disableSuccessMessage': v:true, 'suggest.maxPreviewWidth': 100, 'diagnostic.checkCurrentLine': v:true, 'diagnostic.maxWindowHeight': 20, 'diagnostic.errorSign': '✖', 'diagnostic.warningSign': '⚠', 'diagnostic.infoSign': '●', 'diagnostic.hintSign': '○'}")

Here are the project configurations: packege.json

{
  "name": "workflow_standart",
  "version": "1.0.0",
  "description": "",
  "main": "gulpfile.js",
  "type": "module",
  "scripts": {
    "dev": "gulp watch",
    "build": "gulp build --build",
    "zip": "gulp deployZIP --build",
    "deploy": "gulp deployFTP --build",
    "svgSprive": "gulp svgSprive"
  },
  "author": "FLS",
  "license": "ISC",
  "dependencies": {
    "aos": "^2.3.4",
    "css-loader": "^6.7.1",
    "css-minimizer-webpack-plugin": "^4.0.0",
    "gulp-cli": "^2.3.0",
    "jquery": "^3.6.0",
    "mini-css-extract-plugin": "^2.6.1",
    "showctrl": "^1.0.2",
    "style-loader": "^3.3.1"
  },
  "devDependencies": {
    "browser-sync": "latest",
    "del": "latest",
    "eslint": "^8.22.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-prettier": "^4.2.1",
    "gulp": "latest",
    "gulp-autoprefixer": "latest",
    "gulp-clean-css": "latest",
    "gulp-data": "^1.3.1",
    "gulp-file-include": "latest",
    "gulp-fonter-2": "^0.3.0",
    "gulp-group-css-media-queries": "latest",
    "gulp-if": "latest",
    "gulp-imagemin": "latest",
    "gulp-newer": "latest",
    "gulp-notify": "latest",
    "gulp-nunjucks-render": "^2.2.3",
    "gulp-plumber": "latest",
    "gulp-pug": "latest",
    "gulp-rename": "latest",
    "gulp-replace": "latest",
    "gulp-sass": "latest",
    "gulp-svg-sprite": "latest",
    "gulp-ttf2woff2": "latest",
    "gulp-util": "latest",
    "gulp-version-number": "latest",
    "gulp-webp": "latest",
    "gulp-webp-html-nosvg": "latest",
    "gulp-webpcss": "latest",
    "gulp-zip": "latest",
    "htmlhint": "^1.1.4",
    "prettier": "^2.8.3",
    "sass": "latest",
    "smart-grid": "^2.1.2",
    "stylelint": "^14.16.1",
    "stylelint-config-prettier-scss": "^0.0.1",
    "stylelint-config-standard-scss": "^6.1.0",
    "swiper": "latest",
    "vinyl-ftp": "latest",
    "webp-converter": "2.2.3",
    "webpack": "latest",
    "webpack-stream": "latest"
  }
}

stylelintrc.json

{
  "extends": [
    "stylelint-config-standard-scss",
    "stylelint-config-prettier-scss"
  ]
}

When I run npx stylelint ./src/style/base/button.scss Validation works correctly image

If I open the project in VSCode, it also works correctly

image

But nvim does not show errors image

If I run :CocList extensions , I see that coc-stylelintplus is enabled image

But if I try to access a command with stylelintplus, I only see one command in the tooltip, but there should be more as I understand it image

If I enter the command :CocCommand workspace.showOutput and select stylelintplus in the list, I get a configuration error.

[Info  - 14:34:59.120] stylelint running in node v16.19.0
Error when trying to validate file:///home/mr/project/maksim/ukrgumbat/template/src/style/base/button.scss Error: No rules found within configuration. Have you provided a "rules" property?
    at configurationError (/home/mr/project/maksim/ukrgumbat/template/node_modules/stylelint/lib/utils/configurationError.js:11:49)
    at augmentConfigFull (/home/mr/project/maksim/ukrgumbat/template/node_modules/stylelint/lib/augmentConfig.js:119:9)
    at async isPathIgnored (/home/mr/project/maksim/ukrgumbat/template/node_modules/stylelint/lib/isPathIgnored.js:27:17)
    at async lintSource (/home/mr/project/maksim/ukrgumbat/template/node_modules/stylelint/lib/lintSource.js:41:20)
    at async Function.standalone [as lint] (/home/mr/project/maksim/ukrgumbat/template/node_modules/stylelint/lib/standalone.js:129:26)
    at async Object.lint (/home/mr/.config/coc/extensions/node_modules/coc-stylelintplus/node_modules/stylelint-lsp/dist/settings.js:68:28)
    at async validate (/home/mr/.config/coc/extensions/node_modules/coc-stylelintplus/node_modules/stylelint-lsp/dist/validate.js:37:36)
    at async /home/mr/.config/coc/extensions/node_modules/coc-stylelintplus/node_modules/stylelint-lsp/dist/validate.js:116:13 {
  code: 78
}

I think stylelintplus can't see my .stylelintrc.json file. Although this file is in the root of my project image

mr-scrpt avatar Jan 30 '23 12:01 mr-scrpt