Skip to content

Commit

Permalink
fix rules mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
Глебка Фокин committed Sep 25, 2018
1 parent 1b5bc03 commit b22f98c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/index.js
@@ -1,11 +1,13 @@
const rules = {
'no-dynamic-import-moment': require('./rules/no-dynamic-import-moment'),
'no-import-moment': require('./rules/no-import-moment'),
'no-moment-constructor': require('./rules/no-moment-constructor'),
'no-require-moment': require('./rules/no-require-moment')
};

Object.assign(rules, require('./rules/no-moment-methods'));
const rules = Object.assign(
{},
{
'no-dynamic-import-moment': require('./rules/no-dynamic-import-moment'),
'no-import-moment': require('./rules/no-import-moment'),
'no-moment-constructor': require('./rules/no-moment-constructor'),
'no-require-moment': require('./rules/no-require-moment'),
},
require('./rules/no-moment-methods')
);

module.exports.rules = rules;

Expand All @@ -14,6 +16,7 @@ const configure = (list, level) => {
Object.keys(list).map(rule => (r['you-dont-need-momentjs/' + rule] = level));
return r;
};

module.exports.configs = {
recommended: {
plugins: ['you-dont-need-momentjs'],
Expand Down

0 comments on commit b22f98c

Please sign in to comment.