Giter Site home page Giter Site logo

Comments (31)

suretrust avatar suretrust commented on May 31, 2024 25

Just run

npm install --save-dev stylelint stylelint-scss stylelint-config-standard stylelint-csstree-validator

or

yarn add stylelint stylelint-scss stylelint-config-standard stylelint-csstree-validator

as the case may be.

from linter-stylelint.

gitanupam avatar gitanupam commented on May 31, 2024 12

FYI: Alright, for those who end up Googling here with the same issue, here are three ways to resolve the error: Could not find "stylelint-config-standard". Do you need a configBasedir?

  1. Add the absolute path as in this comment by @paulrobertlloyd.
  2. If you don't intend to change/extend the standard rules, you can just do this. I think the checkbox is called 'Use Standard' now (Also, I think that should be checked by default - opened an issue here to check with folks).
  3. If you do want to change the rules (like I don't like mandating empty lines before comments), but don't want to put down absolute paths (like in (1) above) either, then just do npm install stylelint-config-standard (as @Arcanemagus suggests here) in your project's root folder and it will then be able to find the rules to refer to. (This is what I ended up doing)

from linter-stylelint.

paulrobertlloyd avatar paulrobertlloyd commented on May 31, 2024 3

Okay, with this in mind, updated my config to point directly to the stylelint-config-standard module folder within the linter-stylelint package, like so:

"stylelint": {
    "extends": "/Volumes/Macintosh/Users/paulrobertlloyd/.atom/packages/linter-stylelint/node_modules/stylelint-config-standard",
    "rules": {
        "indentation": 4
    }
}

But that’s not going to work across different machines. Should this package set the configBasedir value to the location of the package’s node_modules folder?

from linter-stylelint.

AmaliaGM avatar AmaliaGM commented on May 31, 2024 2

Just run

npm install --save-dev stylelint stylelint-scss stylelint-config-standard stylelint-csstree-validator

or

yarn add stylelint stylelint-scss stylelint-config-standard stylelint-csstree-validator

as the case may be.

This worked! Thanks so much!

from linter-stylelint.

SeanHayes avatar SeanHayes commented on May 31, 2024

Same here, but I'm not using linter-stylelint, just stylelint directly.

from linter-stylelint.

davidtheclark avatar davidtheclark commented on May 31, 2024

If you have a problem happening with stylelint that you can reproduce outside of Atom editor and the linter-stylelint problem, please file an issue with stylelint instead of here: https://github.com/stylelint/stylelint/issues. If the problem only occurs when linter-stylelint is involved, then the issue is appropriate here.

from linter-stylelint.

SeanHayes avatar SeanHayes commented on May 31, 2024

Here's the issue I opened: stylelint/stylelint-config-standard#4

from linter-stylelint.

davidtheclark avatar davidtheclark commented on May 31, 2024

Cool, thanks @SeanHayes.

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

@paulrobertlloyd I think that this would be a duplicate of #51 if that's the case here. This is definitely something that should be moved towards as all the Node based linters should be able to use the project based one (which would include getting the configuration from the project and not the plugin itself).

Is that the case here?

from linter-stylelint.

paulrobertlloyd avatar paulrobertlloyd commented on May 31, 2024

Hmmm, not really. I haven’t installed stylelint into my project, so I am relying on the version included within this plugin. The problem is (I think), that this plugin doesn’t appear to know where config presets are located. Does that make sense?

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

Sorry, forgot to respond here: Yes that makes sense, but that is exactly what #51 would solve 😉.

from linter-stylelint.

hkongm avatar hkongm commented on May 31, 2024

same problem

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

Okay, after working on a similar issue and with a greater understanding of how generating the config is done... this should be working.

@paulrobertlloyd and @hkongm can you provide an exact folder structure including where you have your configuration files, and what file you are linting when you see this issue?

from linter-stylelint.

paulrobertlloyd avatar paulrobertlloyd commented on May 31, 2024

I am still getting the same error. You can see my folder structure here: https://github.com/paulrobertlloyd/paulrobertlloyd.com (my .stylelintrc config file appears in the project root). I get this error if I add "extends": "stylelint-config-standard" to my config file, or check ‘Use standard’ in linter-stylelint’s settings.

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

@paulrobertlloyd extends is an array key, not a single element. Also do you have something installing stylelint-config-standard into your project?

If I clone your repository as it currently is (paulrobertlloyd/paulrobertlloyd-v3@65e71ab), linter-stylelint works just fine, although it will only show fatal errors unless the "Use preset" is checked.

If I add "extends": ["stylelint-config-standard"] to your .stylelintrc and run npm install stylelint-config-standard in your project (since you have no package.json saying it should be there), everything works as expected as well.

I am unable to reproduce using your repository if everything is setup properly.

from linter-stylelint.

ismay avatar ismay commented on May 31, 2024

I've got the same error, but for stylelint-selector-bem-pattern:

screen shot 2016-03-16 at 22 15 13

Code that resulted in this error can be found in this branch.

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

@ismay You must be on an older version of the plugin, the latest version bundles stylelint@^5.0.1 which throws errors about the (now) undefined rules in your configuration.

Specifically:
image

from linter-stylelint.

ismay avatar ismay commented on May 31, 2024

@Arcanemagus I am on 2.0.1 of linter-stylelint, so that shouldn't be the problem. It can't be picking up the version from my package.json right? Because that's "stylelint": "^4.4.0".

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

@ismay If you are supposedly on v2.0.1 of linter-stylelint then Atom didn't install the dependencies correctly, since that has a minimum version of v5.0.1 for the bundled stylelint, and that version is incompatible with the rules you have specified in your .stylelintrc file. Specifically you are extending stylelint-config-suitcss, which hasn't updated for stylelint@^5.0.0 yet.

You might try uninstalling the package and installing it again?

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

Ah, just saw that I was still on your master branch, I get the error you are seeing as well on the lint-bem branch and will look into it (Without the stylelint-selector-bem-pattern though you would be hitting the stylelint-config-suitcss issues...).

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

@ismay Looks like your issue is fixed in stylelint/stylelint#913, which hasn't been released yet.

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

@hkongm Can you post the requested information?

from linter-stylelint.

ismay avatar ismay commented on May 31, 2024

@Arcanemagus You're right. That's why I'm installing stylelint 4 locally (and opened this issue). But that won't fix the incompatibility of those rules with linter-stylelint of course. Didn't know that stylelint used its own version of stylelint at the time.

But anyway, my reported error should then be fixed when pr #913 is released and used with linter-stylelint. Thanks for the quick replies!

from linter-stylelint.

paulrobertlloyd avatar paulrobertlloyd commented on May 31, 2024

I think regarding my original issue, this fixes everything for me. For projects where I don’t have stylelint installed (i.e. no node modules or package.json), I can check the ’use standard presets’ option in the package settings, and then everything will work as expected (whereas it didn’t before).

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

@paulrobertlloyd I figured, and as @hkongm hasn't responded in 10 days I'm going to mark this as closed.

@hkongm if you are still experiencing this problem please file a new issue with the information requested here and we can diagnose what your issue is.

from linter-stylelint.

nottoseethesun avatar nottoseethesun commented on May 31, 2024

@gitanupam - I tried #3 above and that did not work. However the similar solution of adding stylelint-processor-styled-components to my package.json (in devDependencies) did work.

from linter-stylelint.

carlkenne avatar carlkenne commented on May 31, 2024

I got this issue probably because my package.json is not in my root folder. Simply adding the full path: "./web/node_modules/stylelint-config-..." fixed it for me

from linter-stylelint.

Arcanemagus avatar Arcanemagus commented on May 31, 2024

@carlkenne Please follow #357, the bug this issue is about was fixed long ago.

from linter-stylelint.

gbpatil avatar gbpatil commented on May 31, 2024

make sure you have downloaded all the dependencies. Run YARN or NPM Install and reverify. Error should go away.

from linter-stylelint.

evanjmg avatar evanjmg commented on May 31, 2024

I made a custom library to host my index.js file to extend and I am getting this. I didn't prefix with stylelint - would that cause it? I get the same error as above.

from linter-stylelint.

JuanmaMenendez avatar JuanmaMenendez commented on May 31, 2024

The solution for me was adding the overrides code to the config

module.exports = {
	overrides: [
		{
			files: ["**/*.scss"],
			customSyntax: "postcss-scss"
		}
	],
	rules: {...	},
}

from linter-stylelint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.