Skip to content

Commit f03fba5

Browse files
committed
first draft of no-deprecated test + empty rule
1 parent 4ad9cb5 commit f03fba5

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

src/rules/no-deprecated.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Exports from '../core/getExports'
2+
3+
module.exports = function (context) {
4+
return {
5+
'ImportDeclaration': function (n) {
6+
// check specifiers
7+
},
8+
}
9+
}

tests/files/deprecated.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* this function is terrible
3+
* @deprecated please use 'x' instead.
4+
* @return null
5+
*/
6+
export function fn() { return null }

tests/src/rules/no-deprecated.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as path from 'path'
2+
import { test } from '../utils'
3+
4+
import { RuleTester } from 'eslint'
5+
6+
const ruleTester = new RuleTester()
7+
, rule = require('rules/no-deprecated')
8+
9+
ruleTester.run('no-deprecated', rule, {
10+
valid: [
11+
test({ code: "import { x } from './fake' " }),
12+
test({ code: "import bar from './bar'" }),
13+
],
14+
invalid: [
15+
test({
16+
code: "import { fn } from './deprecated'",
17+
errors: ["Deprecated: please use 'x' instead."],
18+
}),
19+
],
20+
})

0 commit comments

Comments
 (0)