Skip to content

Commit

Permalink
Upgrade upstream config and plugins to ESLint 6
Browse files Browse the repository at this point in the history
  • Loading branch information
billyjanitsch committed Aug 16, 2019
1 parent 1998b9b commit cd4cc6a
Show file tree
Hide file tree
Showing 4 changed files with 715 additions and 737 deletions.
12 changes: 11 additions & 1 deletion __snapshots__/test.js.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`lints all JS fixtures: component.js 1`] = `Array []`;
exports[`lints all JS fixtures: component.js 1`] = `
Array [
Object {
"column": 7,
"line": 72,
"message": "Prefer fragment shorthand over React.Fragment",
"rule": "react/jsx-fragments",
"severity": 2,
},
]
`;

exports[`lints all JS fixtures: exports.js 1`] = `Array []`;

Expand Down
13 changes: 5 additions & 8 deletions javascript.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['airbnb', 'prettier', 'prettier/react'],
plugins: ['prettier', 'react-hooks'],
extends: ['airbnb', 'airbnb/hooks', 'prettier', 'prettier/react'],
plugins: ['prettier'],
parser: 'babel-eslint',
env: {
// allow browser globals
Expand Down Expand Up @@ -38,12 +38,6 @@ module.exports = {
},
],

// disallow invalid uses of React hooks
'react-hooks/rules-of-hooks': 2,

// require valid dependency arrays in React hooks
'react-hooks/exhaustive-deps': 2,

// disallow .jsx files for consistency
'react/jsx-filename-extension': 0,

Expand Down Expand Up @@ -93,6 +87,9 @@ module.exports = {
},
},
],

// require statics to be declared as public fields
'react/static-property-placement': [2, 'static public field'],
},
settings: {
// do not attempt to parse npm modules or non-JS files for exports
Expand Down

0 comments on commit cd4cc6a

Please sign in to comment.