AlloyTeam / eslint-config-alloy

Progressive ESLint config for your React/Vue/TypeScript projects
https://alloyteam.github.io/eslint-config-alloy/
2.65k stars 317 forks source link

[feature] eslint rules conflict with mocha timeout #250

Closed brick9527 closed 1 year ago

brick9527 commented 1 year ago

When I write a mocha test script, it shows an error with no-valid-this

test demo:

describe('my title', () => {
  it('test something', () => {
    this.timeout(1000);
    // do something...
  });
});

mocha timeout refference: https://mochajs.org/#timeouts

xcatliu commented 1 year ago

You can turn off no-invalid-this in your eslintrc file. Alternatively, a better approach would be to use "override" to make it effective only in */.test.js files.