Skip to content

Commit a7b47de

Browse files
committed
test case from jsx-eslint#1107
1 parent bc5435d commit a7b47de

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"coveralls": "cat ./reports/coverage/lcov.info | coveralls",
99
"lint": "eslint ./",
1010
"test": "npm run lint && npm run unit-test",
11-
"unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/**/*.js -- --reporter dot"
11+
"unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/**/*.js -- --reporter dot",
12+
"debug": "node_modules/mocha/bin/_mocha tests/lib/rules/no-unused-prop-types.js",
13+
"test:debug": "$(npm bin)/mocha --inspect --debug-brk tests/lib/rules/no-unused-prop-types.js"
1214
},
1315
"files": [
1416
"LICENSE",

tests/lib/rules/no-unused-prop-types.js

+15
Original file line numberDiff line numberDiff line change
@@ -1914,6 +1914,21 @@ ruleTester.run('no-unused-prop-types', rule, {
19141914
' test: React.PropTypes.bool',
19151915
'};'
19161916
].join('\n')
1917+
}, {
1918+
// issue 1107
1919+
code: [
1920+
'const Test = props => <div>',
1921+
' {someArray.map(l => <div',
1922+
' key={l}>',
1923+
' {props.property + props.property2}',
1924+
' </div>)}',
1925+
'</div>',
1926+
1927+
'Test.propTypes = {',
1928+
' property: React.propTypes.string.isRequired,',
1929+
' property2: React.propTypes.string.isRequired',
1930+
'}'
1931+
].join('\n')
19171932
}
19181933
],
19191934

0 commit comments

Comments
 (0)