Skip to content
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

Eslint: add comma-dangle always multi-line rule #1163

Merged
merged 2 commits into from
Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const semver = require('semver');
const reactVersion = semver.coerce(require('./package.json').dependencies.react).version;

const defaultRules = {
'comma-dangle': [2, 'never'],
'comma-dangle': [2, 'always-multiline'],
'comma-spacing': [2, { before: false, after: true }],
curly: [2, 'multi-line'],
eqeqeq: [2, 'smart'],
Expand Down
8 changes: 4 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ module.exports = {
['@babel/preset-env', {
corejs: 2,
modules: 'commonjs',
useBuiltIns: 'usage'
useBuiltIns: 'usage',
}],
['@babel/preset-react']
['@babel/preset-react'],
],
plugins: compact([
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-optional-chaining',
'angularjs-annotate',
isDevelopment && 'react-refresh/babel'
])
isDevelopment && 'react-refresh/babel',
]),
};
4 changes: 2 additions & 2 deletions bin/db-maintenance/archive-done-agenda-jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async.waterfall([
process.stdout.clearLine();
process.stdout.cursorTo(0);
process.stdout.write(
'~' + progressPercent + '% (' + progress + '/' + total + ')'
'~' + progressPercent + '% (' + progress + '/' + total + ')',
);
}
++progress;
Expand Down Expand Up @@ -239,7 +239,7 @@ async.waterfall([
countTotals(function () {
done(null, progress);
});
}
},

], function (err, totalProcessed) {
if (err) {
Expand Down
4 changes: 2 additions & 2 deletions bin/fillTestData/Messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const argv = yargs.usage('$0 <numberOfThreads> <maxMessages>',
return yargs
.positional('numberOfThreads', {
describe: 'Number of threads to add',
type: 'number'
type: 'number',
})
.positional('maxMessages', {
describe: 'Maximum number of messages per thread to add',
type: 'number'
type: 'number',
})
.boolean('debug')
.boolean('limit')
Expand Down
4 changes: 2 additions & 2 deletions bin/fillTestData/Tribes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const argv = yargs.usage('$0 <numberOfTribes>', 'Seed database with number of tr
return yargs
.positional('numberOfTribes', {
describe: 'Number of tribes to add',
type: 'number'
type: 'number',
})
.boolean('debug')
.boolean('limit')
Expand Down Expand Up @@ -66,7 +66,7 @@ const tribeImageUUIDs = [
'0ce0abdf-6898-4191-9a86-4f03807291b5',
'0ebcabec-2bc5-4eee-ab17-991b9dd52eae',
'4f7805e7-b5e6-4b40-bb32-3aafbe1bbc74',
'69a500a4-a16e-4c4d-9981-84fbe310d531'
'69a500a4-a16e-4c4d-9981-84fbe310d531',
];

/**
Expand Down
2 changes: 1 addition & 1 deletion bin/fillTestData/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const argv = yargs.usage('$0 <numberOfUsers>', 'Seed database with number of tri
return yargs
.positional('numberOfUsers', {
describe: 'Number of users to add',
type: 'number'
type: 'number',
})
.array('userNames')
.boolean('debug')
Expand Down
4 changes: 2 additions & 2 deletions bin/install-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (!fs.existsSync('node_modules')) {
console.log('No "node_modules" present, installing NPM dependencies...');
const installResult = spawnSync('npm', [ 'ci' ], {
shell: true,
stdio: 'inherit'
stdio: 'inherit',
}).status;
if (installResult) {
process.exit(installResult);
Expand Down Expand Up @@ -45,7 +45,7 @@ if (!fs.existsSync('node_modules')) {
console.log('NPM dependencies out of date. Updating...');
const installResult = spawnSync('npm', [ 'ci' ], {
shell: true,
stdio: 'inherit'
stdio: 'inherit',
}).status;
if (installResult) {
process.exit(installResult);
Expand Down
14 changes: 7 additions & 7 deletions config/assets/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'progressbar',
'tabs',
'tooltip',
'typeahead'
'typeahead',
],
js: [
// Non minified versions
Expand Down Expand Up @@ -56,18 +56,18 @@ module.exports = {
'node_modules/angular-mailcheck/angular-mailcheck.js',
'node_modules/angular-locker/dist/angular-locker.js',
'node_modules/angular-confirm/angular-confirm.js',
'node_modules/angulargrid/angulargrid.js'
'node_modules/angulargrid/angulargrid.js',
],
tests: ['node_modules/angular-mocks/angular-mocks.js']
tests: ['node_modules/angular-mocks/angular-mocks.js'],
},
js: [
'modules/core/client/app/config.js',
'modules/core/client/app/init.js',
'modules/*/client/*.js',
'modules/*/client/controllers/*.js',
'modules/*/client/**/*.js'
'modules/*/client/**/*.js',
],
views: ['modules/*/client/views/**/*.html']
views: ['modules/*/client/views/**/*.html'],
},
server: {
fontelloConfig: 'modules/core/client/fonts/fontello/config.json',
Expand All @@ -79,6 +79,6 @@ module.exports = {
config: 'modules/*/server/config/*.js',
policies: 'modules/*/server/policies/*.js',
views: 'modules/*/server/views/*.html',
migrations: 'migrations/*.js'
}
migrations: 'migrations/*.js',
},
};
8 changes: 4 additions & 4 deletions config/assets/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ module.exports = {
lib: {
uibModuleTemplates: defaultAssets.client.lib.uibModuleTemplates,
js: _.union(defaultAssets.client.lib.js, [
'node_modules/angulartics/src/angulartics-debug.js'
'node_modules/angulartics/src/angulartics-debug.js',
]),
tests: defaultAssets.client.lib.tests
tests: defaultAssets.client.lib.tests,
},
js: defaultAssets.client.js,
views: defaultAssets.client.views
}
views: defaultAssets.client.views,
},
};
10 changes: 5 additions & 5 deletions config/assets/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ module.exports = {
lib: {
uibModuleTemplates: defaultAssets.client.lib.uibModuleTemplates,
js: _.union(defaultAssets.client.lib.js, [
'node_modules/angulartics-google-analytics/lib/angulartics-ga.js'
'node_modules/angulartics-google-analytics/lib/angulartics-ga.js',
]),
tests: defaultAssets.client.lib.tests
tests: defaultAssets.client.lib.tests,
},
js: _.union(defaultAssets.client.js, [
'public/dist/uib-templates.js',
'public/dist/templates.js'
'public/dist/templates.js',
]),
views: defaultAssets.client.views
}
views: defaultAssets.client.views,
},
};
8 changes: 4 additions & 4 deletions config/assets/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ module.exports = {
uibModuleTemplates: defaultAssets.client.lib.uibModuleTemplates,
css: defaultAssets.client.lib.css,
js: _.union(defaultAssets.client.lib.js, [
'testutils/client/angulartics-null.testutil.js'
'testutils/client/angulartics-null.testutil.js',
]),
less: defaultAssets.client.lib.less,
tests: defaultAssets.client.lib.tests
tests: defaultAssets.client.lib.tests,
},
less: defaultAssets.client.less,
js: defaultAssets.client.js,
views: defaultAssets.client.views
}
views: defaultAssets.client.views,
},
};
12 changes: 6 additions & 6 deletions config/client/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ i18n
.init({
...(isTest ? {
resources: {
en: {}
}
en: {},
},
} : {}),
fallbackLng: 'en', // a default app locale
// allow keys to be phrases having `:`, `.`
Expand All @@ -74,16 +74,16 @@ i18n
// saveMissing: true, // @TODO send not translated keys to endpoint
interpolation: {
escapeValue: false, // react already safes from xss
format
format,
},
detection: {
lookupCookie: 'i18n',
order: ['cookie'],
caches: ['cookie']
caches: ['cookie'],
},
react: {
useSuspense: false
}
useSuspense: false,
},
// saveMissingPlurals: true,
// debug: true // show missing translation keys in console.log
});
Expand Down
10 changes: 5 additions & 5 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const initGlobalConfigFolders = function (config) {
// Appending files
config.folders = {
server: {},
client: {}
client: {},
};

// Setting globbed client paths
Expand All @@ -91,9 +91,9 @@ const initGlobalConfigFiles = function (config, assets) {
config.files = {
server: {},
client: {
lib: {}
lib: {},
},
webpack: {}
webpack: {},
};

// Setting Globbed model files
Expand Down Expand Up @@ -154,7 +154,7 @@ const initGlobalConfig = function () {
*/
let config = _.extend(
require(path.join(process.cwd(), 'config/env/default')),
require(path.join(process.cwd(), 'config/env/', process.env.NODE_ENV)) || {}
require(path.join(process.cwd(), 'config/env/', process.env.NODE_ENV)) || {},
);
config = _.merge(config, (fs.existsSync('./config/env/local.js') && require('./env/local.js')) || {});

Expand All @@ -166,7 +166,7 @@ const initGlobalConfig = function () {

// Expose configuration utilities
config.utils = {
getGlobbedPaths: getGlobbedPaths
getGlobbedPaths: getGlobbedPaths,
};

return config;
Expand Down
Loading