Skip to content

Commit

Permalink
Add deprecated flags to imports-first metadata (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
randycoulman authored and benmosher committed Nov 2, 2016
1 parent cf42834 commit 2602b5d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -34,7 +34,7 @@ export const rules = {
'no-deprecated': require('./rules/no-deprecated'),

// deprecated aliases to rules
'imports-first': require('./rules/first'),
'imports-first': require('./rules/imports-first'),
}

export const configs = {
Expand Down
5 changes: 5 additions & 0 deletions src/rules/imports-first.js
@@ -0,0 +1,5 @@
import first from './first'

const newMeta = Object.assign({}, first.meta, { deprecated: true })

module.exports = Object.assign({}, first, { meta: newMeta })
6 changes: 5 additions & 1 deletion tests/src/package.js
Expand Up @@ -53,5 +53,9 @@ describe('package', function () {
}
})

})
it('marks deprecated rules in their metadata', function () {
expect(module.rules['imports-first'].meta.deprecated).to.be.true
expect(module.rules['first'].meta.deprecated).not.to.be.true
})

})

0 comments on commit 2602b5d

Please sign in to comment.