diff --git a/eslint/react-strict.js b/eslint/react-strict.js new file mode 100644 index 00000000..8c925240 --- /dev/null +++ b/eslint/react-strict.js @@ -0,0 +1 @@ +module.exports = require('../dist/config/eslintrc-react-strict') diff --git a/src/config/__tests__/__snapshots__/eslintrc.js.snap b/src/config/__tests__/__snapshots__/eslintrc.js.snap index 4e890142..5b89d074 100644 --- a/src/config/__tests__/__snapshots__/eslintrc.js.snap +++ b/src/config/__tests__/__snapshots__/eslintrc.js.snap @@ -261,6 +261,26 @@ Object { } `; +exports[`Strict ESLint React configuration 1`] = ` +Object { + "rules": Object { + "react/function-component-definition": Array [ + "error", + Object { + "namedComponents": "arrow-function", + "unnamedComponents": "arrow-function", + }, + ], + "react/jsx-sort-props": Array [ + "error", + Object { + "reservedFirst": false, + }, + ], + }, +} +`; + exports[`Strict ESLint configuration 1`] = ` Object { "rules": Object { diff --git a/src/config/__tests__/eslintrc.js b/src/config/__tests__/eslintrc.js index 8d0a1e95..414d55e8 100644 --- a/src/config/__tests__/eslintrc.js +++ b/src/config/__tests__/eslintrc.js @@ -1,6 +1,7 @@ import eslint from '../eslintrc' import eslintStrict from '../eslintrc-strict' import eslintReact from '../eslintrc-react' +import eslintReactStrict from '../eslintrc-react-strict' import { winPathSerializer, @@ -21,3 +22,7 @@ test('Strict ESLint configuration', () => { test('ESLint React configuration', () => { expect(eslintReact).toMatchSnapshot() }) + +test('Strict ESLint React configuration', () => { + expect(eslintReactStrict).toMatchSnapshot() +}) diff --git a/src/config/eslintrc-react-strict.js b/src/config/eslintrc-react-strict.js new file mode 100644 index 00000000..08baa224 --- /dev/null +++ b/src/config/eslintrc-react-strict.js @@ -0,0 +1,12 @@ +module.exports = { + rules: { + 'react/jsx-sort-props': ['error', {reservedFirst: false}], + 'react/function-component-definition': [ + 'error', + { + namedComponents: 'arrow-function', + unnamedComponents: 'arrow-function', + }, + ], + }, +}