Skip to content

Added base stylelint configuration. #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

blake-newman
Copy link
Contributor

@blake-newman blake-newman commented Jun 6, 2016

Runs stylelint-webpack-plugin during dev. Perhaps it should run on both? @yyx990803 @chrisvfritz

Base config provided by stylelint. (Fixed one lint issue).

@@ -30,5 +30,14 @@ module.exports = merge(baseWebpackConfig, {
template: 'index.html',
inject: true
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blake-newman I think there should be a comma here, instead of on line 41.

@blake-newman
Copy link
Contributor Author

/ping @chrisvfritz @yyx990803

@chrisvfritz
Copy link
Contributor

@blake-newman Sorry, will take another look at this soon. 😅 I took some time off to attend a wedding earlier this week and am still trying to catch up.

"test": "{{#unit}}npm run unit{{/unit}}{{#unit}}{{#e2e}} && {{/e2e}}{{/unit}}{{#e2e}}npm run e2e{{/e2e}}"{{#eslint}},
{{#eslint}}
"lint:eslint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs"{{/eslint}}{{#stylelint}},
"lint:stylelint": "stylelint 'src/**/*.@(?(s)?(a|c)ss|vue|html)' --config ./.stylelintrc.js --extract"{{/stylelint}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like stylelint can also lint scss and less, but it needs to be run again specifying that extension and syntax. See these usage examples.

Another question - what will happen with if .vue files use a transpile-to-css language?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question we can probably have sub conditions for syntax. And as using plugin we could do less.

Scss is supported in node blob for files.

Less is currently experimental, to i have avoided it currently. Also I think Less is very little used these days. Especially if starting a new project, as scaffolding is for new projects I think we can leave Less behind until stylelint fully supports it.

@chrisvfritz
Copy link
Contributor

Got this error when trying to use stylelint in a new project:

vue-cli · stylelint doesn't match eslint - 16:68

@blake-newman
Copy link
Contributor Author

Will amend noticed these issues when using today, looks like I missed up my copy paste from other project. Sorry will sort tomorrow morning.

@blake-newman
Copy link
Contributor Author

@chrisvfritz Updated all should be good now, although i would give it a quick run through as little busy and very tired, so may have made a mistake but all seems okay.

@chrisvfritz
Copy link
Contributor

@blake-newman Excellent! Will take a look at this soon, though maybe not this week, as I want to focus on getting those docs done if possible. 😄

@blake-newman
Copy link
Contributor Author

Sure no rush!

@chrisvfritz
Copy link
Contributor

chrisvfritz commented Jul 20, 2016

@blake-newman Just took another look at this and was still getting errors after generating a fresh project. 😕

I'm also concerned about users of unsupported preprocessors, such as stylus, less, or postcss. As far as I can tell, there isn't currently a way for stylelint to only parse style elements with an appropriate lang attribute and I'd hate for builds to start failing when someone adds one of these languages to a project. I just opened an issue for this, in case you want to take a stab at fixing it. 😃

@chrisvfritz
Copy link
Contributor

Huh, it looks like the HTML parsing has been deprecated, so a different strategy entirely may be in order. Possibly by using the stylelint postcss plugin and using it as the first loader for supported languages?

@blake-newman
Copy link
Contributor Author

Yeah, closing this PR for now. Will recreate once stylelint becomes a bit more stable. They are doing rapid amount of changes at the moment. Feels like this should currently be user choice, as we don't want to have to depend on stylelint and have to keep on updating.

@gucong3000
Copy link
Contributor

@blake-newman I would like to complete this PR. Any plan for reopen?

@blake-newman
Copy link
Contributor Author

@gucong3000 You can fork and continue developing on feature/stylelint branch.

@gucong3000
Copy link
Contributor

Related:
#842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants