Skip to content

Commit

Permalink
feat(all): update rules
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinspecker committed Dec 10, 2015
1 parent 5c4e69e commit 319abcf
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 16 deletions.
22 changes: 21 additions & 1 deletion esnext.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config.ecmaFeatures = {
classes: true,
defaultParams: true,
destructuring: true,
experimentalObjectRestSpread: true,
forOf: true,
generators: true,
globalReturn: false,
Expand All @@ -28,4 +29,23 @@ config.ecmaFeatures = {
unicodeCodePointEscape: true
};

module.exports = config;
config.rules['arrow-body-style'] = [2, 'as-needed'];
config.rules['arrow-parens'] = [2, 'as-needed'];
config.rules['arrow-spacing'] = [2, {after: true, before: true}];
config.rules['constructor-super'] = 2;
config.rules['generator-star-spacing'] = [2, {after: true, before: false}];
config.rules['no-arrow-condition'] = 2;
config.rules['no-class-assign'] = 2;
config.rules['no-const-assign'] = 2;
config.rules['no-dupe-class-members'] = 2;
config.rules['no-this-before-super'] = 2;
config.rules['no-var'] = 2;
config.rules['object-shorthand'] = 2;
config.rules['prefer-arrow-callback'] = 2;
config.rules['prefer-const'] = 2;
config.rules['prefer-reflect'] = 2;
config.rules['prefer-spread'] = 2;
config.rules['prefer-template'] = 2;
config.rules['require-yield'] = 2;

module.exports = config;
10 changes: 5 additions & 5 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const configFiles = './gulpfile.babel.js'
, srcFiles = 'index.js'
, testFiles = 'test/*.js';

gulp.task('lint', () => {
return gulp.src([configFiles, srcFiles, testFiles])
gulp.task('lint', () =>
gulp.src([configFiles, srcFiles, testFiles])
.pipe(eslint({
baseConfig: {
ecmaFeatures: conf.ecmaFeatures
Expand All @@ -29,12 +29,12 @@ gulp.task('lint', () => {
.pipe(jscs.reporter('fail'))
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
.pipe(jshint.reporter('fail'))
);

gulp.task('build', ['lint']);

gulp.task('test', ['build'], (cb) => {
gulp.task('test', ['build'], cb => {
gulp.src(['index.js'])
.pipe(istanbul())
.pipe(istanbul.hookRequire())
Expand Down
50 changes: 40 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,76 @@ module.exports = {
node: true
},
rules: {
'accessor-pairs': 2,
'array-bracket-spacing': [2, 'never'],
'block-scoped-var': 2,
'block-spacing': 2,
'brace-style': [2, '1tbs', {allowSingleLine: false}],
'callback-return': 2,
camelcase: 2,
'comma-dangle': [2, 'never'],
'comma-spacing': [2, {
after: true,
before: false
}],
'comma-style': 0,
complexity: [2, 17],
'computed-property-spacing': [2, 'never'],
complexity: [2, 7],
'computed-property-spacing': 2,
'consistent-return': 2,
'consistent-this': [2, 'self'],
curly: 2,
'default-case': 2,
'dot-location': [2, 'property'],
'dot-notation': 2,
eqeqeq: 2,
'eol-last': 2,
'func-names': 0,
'func-style': [2, 'declaration'],
'global-require': 2,
'guard-for-in': 2,
'handle-callback-err': 2,
'id-length': 0,
'id-match': 0,
indent: [2, 2, {SwitchCase: 1, VariableDeclarator: 2}],
'init-declaration': 0,
'key-spacing': [2, {
afterColon: true,
beforeColon: false
}],
'linebreak-style': [2, 'unix'],
'lines-around-comment': 2,
'max-depth': 2,
'max-len': [2, 80, 2],
'max-nested-callbacks': [2, 5],
'max-params': [2, 7],
'max-statements': [2, 15],
'new-cap': [2, {
capIsNew: true,
newIsCap: true
}],
'new-parens': 2,
'newline-after-var': 0,
'no-alert': 2,
'no-array-constructor': 2,
'no-bitwise': 2,
'no-caller': 2,
'no-case-declarations': 2,
'no-catch-shadow': 2,
'no-cond-assign': [2, 'always'],
'no-constant-condition': 2,
'no-continue': 2,
'no-control-regex': 2,
'no-debugger': 2,
'no-delete-var': 2,
'no-div-regex': 2,
'no-dupe-args': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-else-return': 2,
'no-empty': 2,
'no-empty-character-class': 2,
'no-empty-label': 2,
'no-empty-pattern': 2,
'no-eq-null': 2,
'no-eval': 2,
'no-ex-assign': 2,
Expand All @@ -65,23 +85,27 @@ module.exports = {
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implicit-coercion': [2, {boolean: false, number: true, string: true}],
'no-implied-eval': 2,
'no-inline-comments': 2,
'no-inner-declarations': 2,
'no-invalid-regexp': 2,
'no-invalid-this': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': 2,
'no-lone-blocks': 2,
'no-lonely-if': 2,
'no-loop-func': 2,
'no-magic-numbers': 0,
'no-mixed-requires': 0,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {max: 1}],
'no-native-reassign': 2,
'no-negated-condition': 0,
'no-negated-in-lhs': 2,
'no-nested-ternary': 2,
'no-new': 2,
Expand All @@ -92,13 +116,16 @@ module.exports = {
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-param-reassign': 2,
'no-path-concat': 2,
'no-plusplus': 0,
'no-process-env': 2,
'no-process-exit': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-restricted-modules': [2],
'no-restricted-modules': 2,
'no-restricted-syntax': 0,
'no-return-assign': 2,
'no-script-url': 2,
'no-self-compare': 2,
Expand All @@ -115,13 +142,14 @@ module.exports = {
'no-undef-init': 2,
'no-undefined': 0,
'no-underscore-dangle': 2,
'no-unexpected-multiline': 2,
'no-unneeded-ternary': 2,
'no-unreachable': 2,
'no-unused-expressions': 2,
'no-unused-vars': [2, {
args: 'after-used',
vars: 'all'
}],
'no-unused-vars': 2,
'no-use-before-define': [2, 'nofunc'],
'no-useless-call': 2,
'no-useless-concat': 2,
'no-void': 2,
'no-warning-comments': [2, {
location: 'anywhere',
Expand All @@ -132,19 +160,21 @@ module.exports = {
]
}],
'no-with': 2,
'object-curly-spacing': [2, 'never'],
'one-var': 2,
'object-curly-spacing': 2,
'one-var': [2, {let: 'always', var: 'always'}],
'operator-assignment': [2, 'always'],
'operator-linebreak': 2,
'padded-blocks': [2, 'never'],
'quote-props': [2, 'as-needed'],
quotes: [2, 'single'],
radix: 2,
'require-jsdoc': 0,
semi: 2,
'semi-spacing': [2, {
after: true,
before: false
}],
'sort-vars': 0,
'sort-vars': [2, {ignoreCase: true}],
'space-after-keywords': [2, 'always'],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, {
Expand Down

0 comments on commit 319abcf

Please sign in to comment.