Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Fix no project config issue #44

Merged
merged 2 commits into from Dec 15, 2015
Merged

Fix no project config issue #44

merged 2 commits into from Dec 15, 2015

Conversation

Arcanemagus
Copy link
Member

The changes in #41 and #42 made it so if you have no configuration (in other words are using one of the presets) you just get a message that it "Failed to parse config file" since we are requiring a config currently.

This PR changes the behavior so that if cosmiconfig is unable to find a configuration for the project the lint is still ran using the default options from the preset. If usePreset() is false it will still throw a warning message up.

@Arcanemagus Arcanemagus mentioned this pull request Dec 14, 2015
If no project config is found only display an error if usePreset is false, otherwise run the lint with the preset.
@Arcanemagus
Copy link
Member Author

@1000ch can you test this to make sure this still works properly with projects with a configuration?

@Arcanemagus
Copy link
Member Author

Also the remaining "Uncaught (in promise) TypeError: Cannot read property 'filepath' of null", source: /home/travis/build/AtomLinter/linter-stylelint/node_modules/stylelint/dist/buildConfig.js (32) is a bug in stylelint as far as I can tell.

For some reason on import it is attempting to grab a configuration, and then when that fails it never handles that and instead assumes that it succeeded, thus causing this error when it tries to access part of the result which is null.

Note: It looks like this only happens in the v1.4.0-beta0 builds, so import behavior may have changed somehow.

@1000ch
Copy link
Member

1000ch commented Dec 15, 2015

Tested with configuration (.stylelintrc, stylelint.config.js, stylelint section in package.json).

1000ch pushed a commit that referenced this pull request Dec 15, 2015
@1000ch 1000ch merged commit ed8c995 into master Dec 15, 2015
@Arcanemagus Arcanemagus deleted the fix-no-config branch December 15, 2015 06:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants