Comments (31)
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.
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?
- Add the absolute path as in this comment by @paulrobertlloyd.
- 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).
- 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.
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.
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.
Same here, but I'm not using linter-stylelint, just stylelint directly.
from linter-stylelint.
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.
Here's the issue I opened: stylelint/stylelint-config-standard#4
from linter-stylelint.
Cool, thanks @SeanHayes.
from linter-stylelint.
@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.
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.
Sorry, forgot to respond here: Yes that makes sense, but that is exactly what #51 would solve 😉.
from linter-stylelint.
same problem
from linter-stylelint.
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.
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.
@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.
I've got the same error, but for stylelint-selector-bem-pattern
:
Code that resulted in this error can be found in this branch.
from linter-stylelint.
@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.
from linter-stylelint.
@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.
@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.
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.
@ismay Looks like your issue is fixed in stylelint/stylelint#913, which hasn't been released yet.
from linter-stylelint.
@hkongm Can you post the requested information?
from linter-stylelint.
@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.
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.
@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.
@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.
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.
@carlkenne Please follow #357, the bug this issue is about was fixed long ago.
from linter-stylelint.
make sure you have downloaded all the dependencies. Run YARN or NPM Install and reverify. Error should go away.
from linter-stylelint.
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.
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)
- don't fix "color-hex-case": "lower" rule in rgba functinos. HOT 1
- Uncaught Error: Cannot find module 'sb-fs' HOT 2
- Error and stack trace while trying to run stylelint on a file HOT 1
- Uncaught RangeError: path should be a `path.relative()`d string, but got "../../../../duncan/dev/central/web-ui/src/components/common/Component.md" HOT 1
- Don't work with .sass files HOT 2
- EBADF: Bad File Descriptor error HOT 3
- stylelint version way out of date and incompatible with current stylelint rules HOT 4
- How can I get "Possible Errors" to show up as errors and "Stylistic Issues" to show up as warnings? HOT 3
- Provide configfile option from settings?
- Inline and/or manual fix integration? HOT 1
- Crash - Error running stylelint Error: Column start (11) greater than line length (0) for line 8 HOT 1
- stylelint.config.js file is ignored
- Cannot destructure property `isPathValid` of 'undefined' or 'null'. HOT 3
- Plugin not working with stylelint-config-sass-guidelines HOT 2
- Update to latest stylelint HOT 5
- Cannot find module 'atom' (crashes fuzzy-finder)
- Error on line 1 HOT 1
- Dependency Dashboard
- Getting error in Atom about static/index.json? HOT 3
- Stylelint Plugin is not picking up nested syntax configrations
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linter-stylelint.