`prefer-arrow-callback` with `mocha/no-mocha-arrows`
See original GitHub issueTell us about your environment I am running tests in mocha that i want to eslint out!
- ESLint Version: ^4.6.1
- Node Version: v8.1.3
- npm Version: 5.4.1
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
module.exports = {
extends: [
'airbnb',
'prettier',
],
plugins: [
'prettier',
'mocha',
],
globals: {
chai: true,
logger: true,
},
env: {
node: true,
mocha: true,
browser: false,
},
rules: {
'no-console': 'error',
'prefer-arrow-callback': 2,
'mocha/no-mocha-arrows': 'error',
'prettier/prettier': ['error', {
singleQuote: true,
bracketSpacing: false,
trailingComma: 'all',
}],
},
}
What did you do? Please include the actual source code causing the issue.
describe("my suite", function() {
});
What did you expect to happen? The above line should not error out the linter. Since i am using mocha, and mocha prefers anonymous function, not an arrow function.
Currently it errors out because of this rule:
rules: {
'prefer-arrow-callback': 2,
...
I am expecting the arrow functions to be preferred everywhere except inside a case function or a suite function.
The prefer arrow-callback errors out, but it shouldn’t, probably it needs a special configuration.
What actually happened? Please include the actual, raw output from ESLint.
$ x:xx error Unexpected function expression prefer-arrow-callback
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Opened lo1tuma/eslint-plugin-mocha#141.
@paulmelnikow no i did not