Skip to content

Commit

Permalink
Merge pull request #1010 from silvenon/extensions
Browse files Browse the repository at this point in the history
Add a .coffee test proving extension resolve order
  • Loading branch information
ljharb committed Feb 2, 2018
2 parents bc50394 + fdcd4d9 commit 3268a82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/files/bar.coffee
@@ -0,0 +1 @@
console.log 'bar'
14 changes: 13 additions & 1 deletion tests/src/rules/extensions.js
Expand Up @@ -183,7 +183,7 @@ ruleTester.run('extensions', rule, {
},
],
}),
// extension resolve order (#965)
// extension resolve order (#583/#965)
test({
code: [
'import component from "./bar.jsx"',
Expand All @@ -199,6 +199,18 @@ ruleTester.run('extensions', rule, {
},
],
}),
test({
code: 'import "./bar.coffee"',
errors: [
{
message: 'Unexpected use of file extension "coffee" for "./bar.coffee"',
line: 1,
column: 8,
},
],
options: ['never', { js: 'always', jsx: 'always' }],
settings: { 'import/resolve': { 'extensions': ['.coffee', '.js'] } },
}),

test({
code: [
Expand Down

0 comments on commit 3268a82

Please sign in to comment.