Skip to content

Commit

Permalink
Switch to using comma-dangle: always-multiline
Browse files Browse the repository at this point in the history
This is a machine-generated codemod, but it's pretty safe since it was
generated by hooking into eslint's own report.

A few files had to be touched up by hand because there were existing
formatting issues with nested arrays/objects:

src/shared/utils/__tests__/OrderedMap-test.js
src/shared/utils/__tests__/Transaction-test.js
src/shared/utils/__tests__/traverseAllChildren-test.js
src/isomorphic/children/__tests__/ReactChildren-test.js
  • Loading branch information
bgw committed Jun 2, 2015
1 parent e0e8270 commit c089eec
Show file tree
Hide file tree
Showing 214 changed files with 1,336 additions and 1,328 deletions.
4 changes: 1 addition & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ rules:
brace-style: 2
space-after-keywords: 2
strict: 2
# We actually have a transform to support this and we fix this for bundled
# releases but not for the npm package, so enforce it strictly
comma-dangle: [2, never]
comma-dangle: [2, always-multiline]
# Make this a warning for now. We do this in a few places so we might need to
# disable
no-unused-expressions: 2
Expand Down
40 changes: 20 additions & 20 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ module.exports = function(grunt) {
'./*.gem',
'./docs/_site',
'./examples/shared/*.js',
'.module-cache'
'.module-cache',
],
jshint: require('./grunt/config/jshint'),
/*eslint-disable camelcase */
compare_size: require('./grunt/config/compare_size')
compare_size: require('./grunt/config/compare_size'),
/*eslint-enable camelcase */
});

Expand Down Expand Up @@ -91,44 +91,44 @@ module.exports = function(grunt) {
grunt.registerTask('build:basic', [
'jsx:normal',
'version-check',
'browserify:basic'
'browserify:basic',
]);
grunt.registerTask('build:addons', [
'jsx:normal',
'browserify:addons'
'browserify:addons',
]);
grunt.registerTask('build:transformer', [
'jsx:normal',
'browserify:transformer'
'browserify:transformer',
]);
grunt.registerTask('build:min', [
'jsx:normal',
'version-check',
'browserify:min'
'browserify:min',
]);
grunt.registerTask('build:addons-min', [
'jsx:normal',
'browserify:addonsMin'
'browserify:addonsMin',
]);
grunt.registerTask('build:withCodeCoverageLogging', [
'jsx:normal',
'version-check',
'browserify:withCodeCoverageLogging'
'browserify:withCodeCoverageLogging',
]);
grunt.registerTask('build:test', [
'delete-build-modules',
'jsx:test',
'version-check',
'populist:test'
'populist:test',
]);
grunt.registerTask('build:npm-react', [
'version-check',
'jsx:normal',
'npm-react:release'
'npm-react:release',
]);
grunt.registerTask('build:gem-react-source', [
'build',
'gem-react-source:release'
'gem-react-source:release',
]);

grunt.registerTask('webdriver-phantomjs', webdriverPhantomJSTask);
Expand All @@ -138,7 +138,7 @@ module.exports = function(grunt) {
grunt.registerTask('test:webdriver:phantomjs', [
'connect',
'webdriver-phantomjs',
'webdriver-jasmine:local'
'webdriver-jasmine:local',
]);

grunt.registerTask('test:full', [
Expand All @@ -152,7 +152,7 @@ module.exports = function(grunt) {
'sauce-tunnel',
'webdriver-jasmine:saucelabs_android',
'webdriver-jasmine:saucelabs_firefox',
'webdriver-jasmine:saucelabs_chrome'
'webdriver-jasmine:saucelabs_chrome',
]);

grunt.registerTask('test:webdriver:saucelabs', [
Expand All @@ -161,7 +161,7 @@ module.exports = function(grunt) {

'connect',
'sauce-tunnel',
'webdriver-jasmine:saucelabs_' + (process.env.BROWSER_NAME || 'ie8')
'webdriver-jasmine:saucelabs_' + (process.env.BROWSER_NAME || 'ie8'),
]);

grunt.registerTask('test:webdriver:saucelabs:modern', [
Expand All @@ -173,7 +173,7 @@ module.exports = function(grunt) {
'webdriver-jasmine:saucelabs_android',
'webdriver-jasmine:saucelabs_firefox',
'webdriver-jasmine:saucelabs_chrome',
'webdriver-jasmine:saucelabs_ie11'
'webdriver-jasmine:saucelabs_ie11',
]);

grunt.registerTask('test:webdriver:saucelabs:ie', [
Expand All @@ -185,7 +185,7 @@ module.exports = function(grunt) {
'webdriver-jasmine:saucelabs_ie8',
'webdriver-jasmine:saucelabs_ie9',
'webdriver-jasmine:saucelabs_ie10',
'webdriver-jasmine:saucelabs_ie11'
'webdriver-jasmine:saucelabs_ie11',
]);

grunt.registerTask('test:webdriver:saucelabs:ios', [
Expand All @@ -196,13 +196,13 @@ module.exports = function(grunt) {
'sauce-tunnel',
'webdriver-jasmine:saucelabs_ios6_1',
'webdriver-jasmine:saucelabs_ios5_1',
'webdriver-jasmine:saucelabs_ios4'
'webdriver-jasmine:saucelabs_ios4',
]);

grunt.registerTask('test:coverage', [
'build:withCodeCoverageLogging',
'test:webdriver:phantomjs',
'coverage:parse'
'coverage:parse',
]);
grunt.registerTask('fasttest', function() {
grunt.task.run('test');
Expand Down Expand Up @@ -231,7 +231,7 @@ module.exports = function(grunt) {
'npm-react:pack',
'npm-react-tools:release',
'npm-react-tools:pack',
'compare_size'
'compare_size',
]);

// Automate the release!
Expand All @@ -251,7 +251,7 @@ module.exports = function(grunt) {
'release:starter',
'compress',
'release:docs',
'release:msg'
'release:msg',
]);

// The default task - build - to keep setup easy.
Expand Down
28 changes: 14 additions & 14 deletions grunt/config/browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ function simpleBannerify(src) {
// Our basic config which we'll add to to make our other builds
var basic = {
entries: [
'./build/modules/React.js'
'./build/modules/React.js',
],
outfile: './build/react.js',
debug: false,
standalone: 'React',
transforms: [envify({NODE_ENV: 'development'})],
plugins: [collapser],
after: [derequire, simpleBannerify]
after: [derequire, simpleBannerify],
};

var min = {
entries: [
'./build/modules/React.js'
'./build/modules/React.js',
],
outfile: './build/react.min.js',
debug: false,
Expand All @@ -73,12 +73,12 @@ var min = {
// No need to derequire because the minifier will mangle
// the "require" calls.

after: [/*derequire,*/ minify, bannerify]
after: [/*derequire,*/ minify, bannerify],
};

var transformer = {
entries:[
'./vendor/browser-transforms.js'
'./vendor/browser-transforms.js',
],
outfile: './build/JSXTransformer.js',
debug: false,
Expand All @@ -89,25 +89,25 @@ var transformer = {
// collapser passes a number; this would throw.

// plugins: [collapser],
after: [derequire, simpleBannerify]
after: [derequire, simpleBannerify],
};

var addons = {
entries: [
'./build/modules/ReactWithAddons.js'
'./build/modules/ReactWithAddons.js',
],
outfile: './build/react-with-addons.js',
debug: false,
standalone: 'React',
packageName: 'React (with addons)',
transforms: [envify({NODE_ENV: 'development'})],
plugins: [collapser],
after: [derequire, simpleBannerify]
after: [derequire, simpleBannerify],
};

var addonsMin = {
entries: [
'./build/modules/ReactWithAddons.js'
'./build/modules/ReactWithAddons.js',
],
outfile: './build/react-with-addons.min.js',
debug: false,
Expand All @@ -118,21 +118,21 @@ var addonsMin = {
// No need to derequire because the minifier will mangle
// the "require" calls.

after: [/*derequire,*/ minify, bannerify]
after: [/*derequire,*/ minify, bannerify],
};

var withCodeCoverageLogging = {
entries: [
'./build/modules/React.js'
'./build/modules/React.js',
],
outfile: './build/react.js',
debug: true,
standalone: 'React',
transforms: [
envify({NODE_ENV: 'development'}),
require('coverify')
require('coverify'),
],
plugins: [collapser]
plugins: [collapser],
};

module.exports = {
Expand All @@ -141,5 +141,5 @@ module.exports = {
transformer: transformer,
addons: addons,
addonsMin: addonsMin,
withCodeCoverageLogging: withCodeCoverageLogging
withCodeCoverageLogging: withCodeCoverageLogging,
};
8 changes: 4 additions & 4 deletions grunt/config/compare_size.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ var gzip = require('gzip-js');

module.exports = {
files: [
'build/*.js'
'build/*.js',
],
options: {
compress: {
gz: function(contents) {
return gzip.zip(contents, {}).length;
}
},
},
cache: '.grunt/sizecache.json'
}
cache: '.grunt/sizecache.json',
},
};
8 changes: 4 additions & 4 deletions grunt/config/compress.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ var version = grunt.config.data.pkg.version;
module.exports = {
starter: {
options: {
archive: './build/react-' + version + '.zip'
archive: './build/react-' + version + '.zip',
},
files: [
{cwd: './build/starter', src: ['**'], dest: 'react-' + version + '/'}
]
}
{cwd: './build/starter', src: ['**'], dest: 'react-' + version + '/'},
],
},
};
16 changes: 8 additions & 8 deletions grunt/config/jshint.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module.exports = {
src: {
options: {
jshintrc: './src/.jshintrc'
jshintrc: './src/.jshintrc',
},
files: {
// We don't care about src/vendor (we shouldn't be touching this), and
Expand All @@ -12,16 +12,16 @@ module.exports = {
'./src/**/*.js',
'!./src/vendor/**',
'!./src/**/__tests__/**',
'!./src/test/**'
]
}
'!./src/test/**',
],
},
},
project: {
options: {
jshintrc: './.jshintrc'
jshintrc: './.jshintrc',
},
files: {
src: ['./Gruntfile.js', './grunt/**/*.js', './bin/*.js', './vendor/*.js']
}
}
src: ['./Gruntfile.js', './grunt/**/*.js', './bin/*.js', './vendor/*.js'],
},
},
};
14 changes: 7 additions & 7 deletions grunt/config/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ var grunt = require('grunt');

var rootIDs = [
'React',
'ReactWithAddons'
'ReactWithAddons',
];

var normal = {
rootIDs: rootIDs,
getConfig: function() {
return {
commonerConfig: grunt.config.data.pkg.commonerConfig
commonerConfig: grunt.config.data.pkg.commonerConfig,
};
},
sourceDir: 'src',
outputDir: 'build/modules'
outputDir: 'build/modules',
};


var test = {
rootIDs: rootIDs.concat([
'test/all.js',
'**/__tests__/*.js'
'**/__tests__/*.js',
]),
getConfig: function() {
return assign({}, normal.getConfig(), {
mocking: true
mocking: true,
});
},
sourceDir: 'src',
outputDir: 'build/modules'
outputDir: 'build/modules',
};


module.exports = {
normal: normal,
test: test
test: test,
};
6 changes: 3 additions & 3 deletions grunt/config/populist.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function(grunt) {
// (build/jasmine/jasmine.js) as global.jasmine, and to require the
// 'all' module (build/jasmine/all.js) but not expose it globally.
args: ['jasmine:jasmine', 'all:'],
outfile: './build/jasmine.js'
outfile: './build/jasmine.js',
};

var filterExpr = grunt.option('filter');
Expand All @@ -22,11 +22,11 @@ module.exports = function(grunt) {
rootDirectory: 'build/modules',
args: ['test/all:harness'],
requires: [filterExpr],
outfile: './build/react-test.js'
outfile: './build/react-test.js',
};

return {
jasmine: jasmine,
test: test
test: test,
};
};
Loading

0 comments on commit c089eec

Please sign in to comment.