Skip to content

Commit

Permalink
Bump eslint from 5.16.0 to 6.8.0 (mui#20226)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot-preview[bot] authored and EsoterikStare committed Mar 30, 2020
1 parent 470cc85 commit 2a18016
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 81 deletions.
28 changes: 15 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
ecmaVersion: 7,
sourceType: 'module',
},
plugins: ['babel', 'mocha', 'material-ui', 'react-hooks'],
plugins: ['babel', 'material-ui', 'react-hooks'],
settings: {
'import/resolver': {
webpack: {
Expand Down Expand Up @@ -111,23 +111,25 @@ module.exports = {
env: {
mocha: true,
},
extends: ['plugin:mocha/recommended'],
rules: {
// does not work with wildcard imports. Mistakes will throw at runtime anyway
'import/named': false,
'import/named': 'off',
// for expect style assertions
'no-unused-expressions': 'off',

'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'error',
'mocha/no-global-tests': 'error',
'mocha/no-identical-title': 'error',
'mocha/no-nested-tests': 'error',
'mocha/no-pending-tests': 'error',
'mocha/no-return-and-callback': 'error',
'mocha/no-sibling-hooks': 'error',
'mocha/no-skipped-tests': 'error',
'mocha/no-top-level-hooks': 'error',
'mocha/valid-suite-description': 'error',
// no rationale provided in /recommended
'mocha/no-mocha-arrows': 'off',
// definitely a useful rule but too many false positives
// due to `describeConformance`
// "If you're using dynamically generated tests, you should disable this rule.""
'mocha/no-setup-in-describe': 'off',
// `beforeEach` for a single case is optimized for change
// when we add a test we don't have to refactor the existing
// test to `beforeEach`.
// `beforeEach`+`afterEach` also means that the `beforeEach`
// is cleaned up in `afterEach` if the test causes a crash
'mocha/no-hooks-for-single-case': 'off'
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"dtslint": "^3.2.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^5.9.0",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-config-prettier": "^6.2.0",
"eslint-import-resolver-webpack": "^0.12.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-plugin-material-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"dependencies": {
"emoji-regex": "^8.0.0"
},
"devDependencies": {
"babel-eslint": "^10.1.0"
},
"scripts": {
"test": "cd ../../ && cross-env NODE_ENV=test mocha 'packages/eslint-plugin-material-ui/**/*.test.js' --exclude '**/node_modules/**'"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const eslint = require('eslint');
const rule = require('./no-hardcoded-labels');

const ruleTester = new eslint.RuleTester({ parser: 'babel-eslint' });
const ruleTester = new eslint.RuleTester({ parser: require.resolve('babel-eslint') });
ruleTester.run('no-hardcoded-labels', rule, {
valid: [
'<button>{42}</button>',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const eslint = require('eslint');
const rule = require('./restricted-path-imports');

const ruleTester = new eslint.RuleTester({ parserOptions: { sourceType: 'module' } });
const ruleTester = new eslint.RuleTester({
parserOptions: { ecmaVersion: 2015, sourceType: 'module' },
});
ruleTester.run('restricted-path-imports', rule, {
valid: [
"import { Button } from '@material-ui/core'",
Expand Down
Loading

0 comments on commit 2a18016

Please sign in to comment.