-
Notifications
You must be signed in to change notification settings - Fork 14
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
Simplify getGruntConfig in how it retrieves the files to lint #565
Comments
Maybe rather than using the grunt plugin, we could just use npm's eslint modules. See here http://eslint.org/docs/developer-guide/nodejs-api#getformatter. This could be very similar to how we got boxed in with grunt's requirejs plugin. |
I added a new linter above which is simpler in its implementation and more flexible:
To use it, replace the lint tasks in Gruntfile.js with these lines: var lint = require( '../../../chipper/js/grunt/lint' ); // and this import
//...
/**
* Returns a function that lints the specified target.
* @param {string} target 'dir'|'all'|'everything'
* @returns {function}
*/
var runLint = function( target ) {
return function() {
lint( grunt, target, buildConfig );
};
};
grunt.registerTask( 'lint', 'lint js files that are specific to this repository', runLint( 'dir' ) );
grunt.registerTask( 'lint-all', 'lint all js files that are required to build this repository', runLint( 'all' ) );
grunt.registerTask( 'lint-everything', 'lint all js files that are required to build this repository', runLint( 'everything' ) ); You may also need "eslint" in a node_modules, perhaps from chipper/package.json + npm install (somehow I already had one). After code review and testing is complete, we will need to do the following steps:
@pixelzoom, @jonathanolson or @zepumph are you available to review? |
Initial review of the code looks good. Testing this in each repo would be next. I don't see information about what eslint version to use in package.json/etc. @samreid, could we collaborate on this sometime by changing master working copies, running tests in each repository, and then pushing? |
@jonathanolson I'm available today, let me know when is a good time for you to collaborate. |
Whenever, also available today. Message me on Skype? |
@jonathanolson and I looked into this today, and found the new process seems like it is working well. We tested
I'll take it from here. |
I also realized |
Find duplicates didn't "just work" with the new paths, so I inlined getGruntConfig into it (so it will only be called when needed) and created #566. |
I commented in the skype channel:
|
I commented in skype:
|
I commented in skype:
|
Bayes helped catch 3 errors, everything else seems OK. We should also keep our eyes peeled for perennial issues since perennial/package.json changed. |
I wrote in on skype: [4/17/17, 11:08:46 AM] Sam Reid: Dear next deployer, perennial/package.json changed and the next RC or production deploy will help us understand whether it is OK |
I added: [4/17/17, 11:10:37 AM] Sam Reid: I have no idea if/how perennial updates itself. Do we have to pull it manually? Or does it always self-pull? |
It sounds like perennial update is manual, and dev release was made with no trouble. I'll close this until we run into problems. |
Currently there is a ton of conditional logic to determine whether or not a file should be linted for specific tasks. @samreid and I were talking in regards to #1095 and we think that this can be improved.
Shouldn't we just be able to lint all files in the correct repos for the task, and have the built in eslint directives ( like `// eslint-disable') decide on a per file basis if we want to lint it.
The text was updated successfully, but these errors were encountered: