Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade upstream config and plugins to ESLint 6 #43

Merged
merged 1 commit into from
Aug 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
16 changes: 8 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,12 @@ module.exports = {
},
},
],

// permit both styles of state declaration
'react/state-in-constructor': 0,

// 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