Skip to content

Commit

Permalink
add no-useless-path-segments fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Aug 8, 2017
1 parent a3cc1af commit 2657c65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rules/no-useless-path-segments.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function normalize(fn, sep) {
const countRelParent = x => sumBy(x, v => v === '..')

module.exports = {
meta: {},
meta: { fixable: 'code' },

create: function (context) {
const currentDir = path.dirname(context.getFilename())
Expand All @@ -36,6 +36,7 @@ module.exports = {
context.report({
node: source,
message: `Useless path segments for "${value}", should be "${proposed}"`,
fix: fixer => fixer.replaceText(source, JSON.stringify(proposed)),
})
}

Expand Down

0 comments on commit 2657c65

Please sign in to comment.