Skip to content

Switch to Node 4 #78

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

Merged
merged 2 commits into from
Apr 16, 2017
Merged

Switch to Node 4 #78

merged 2 commits into from
Apr 16, 2017

Conversation

simonsmith
Copy link
Member

Fixes #75

@simonsmith simonsmith requested a review from giuseppeg April 9, 2017 19:03
@giuseppeg
Copy link
Member

@simonsmith awesome! I'll take a look this week

@simonsmith
Copy link
Member Author

@giuseppeg Think you can look today? I'm going to have some free time over the weekend so I'll get #72 sorted too and publish a new version

@giuseppeg
Copy link
Member

hey @simonsmith sorry man I am afraid that I won't be able to look at it before the weekend.
Be sure though that if I manage to find five free minutes I'll take a look – I believe that it is syntax changes mostly.

@simonsmith
Copy link
Member Author

@giuseppeg Yeah, most of it was just put through lebab and then tweaked with ESLint

@simonsmith
Copy link
Member Author

In fact I can just work off this branch and merge later. So no worries

Copy link
Member

@giuseppeg giuseppeg left a comment

Choose a reason for hiding this comment

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

looks good to me :)

var exists = fs.existsSync;
var resolve = path.resolve;
var writeFileSync = fs.outputFileSync;
'use strict';
Copy link
Member

Choose a reason for hiding this comment

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

do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I get an error saying to use const and let it has to be in strict mode.

Copy link
Member

Choose a reason for hiding this comment

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

maybe some eslint rule that we can remove?

Copy link
Member Author

Choose a reason for hiding this comment

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

The error comes directly from Node

Copy link
Member Author

@simonsmith simonsmith Apr 15, 2017

Choose a reason for hiding this comment

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

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)

An odd limitation I didn't know about but I guess we should be running in strict anyway

Copy link
Member

Choose a reason for hiding this comment

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

same, it seems that we could pass --use_strict to mocha or node but shrug lets keep "use strict"

Copy link
Member Author

Choose a reason for hiding this comment

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

I suppose we couldn't be sure it would be run that way by users. I noticed stylelint add it so probably wise to follow suit 👍

const reporter = require('postcss-reporter');
const stylelint = require('stylelint');
const stylelintConfigSuit = require('stylelint-config-suitcss');
let postcss = require('postcss'); // eslint-disable-line prefer-const
Copy link
Member

Choose a reason for hiding this comment

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

why let?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just so the rewire library can override it in the tests

const test = require('tape-css')(require('tape'));
const styles = require('../fixtures/encapsulation.out.css');

const dom = ((() => {
Copy link
Member

Choose a reason for hiding this comment

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

the additional expression to wrap the iife is probably unnecessary (() => {})() should be enough

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah okay, just a copy paste from lebab. Will update

@simonsmith simonsmith merged commit 4357309 into master Apr 16, 2017
@simonsmith simonsmith deleted the node-4 branch April 16, 2017 10:29
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.

2 participants