Skip to content

Commit

Permalink
fix: Fix config definitions after changing from plugin to config type
Browse files Browse the repository at this point in the history
  • Loading branch information
tomfin46 committed Oct 17, 2019
1 parent cb33b65 commit e3d6552
Showing 9 changed files with 142 additions and 257 deletions.
42 changes: 42 additions & 0 deletions base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
plugins: ['lodash'],
extends: [
'plugin:prettier/recommended',
],
parser: 'babel-eslint',
rules: {
// No need to convert between OS platforms
'linebreak-style': 'off',
'require-await': 'error',
// Allow dev dependencies to be explicitly required in tools and such
'import/no-extraneous-dependencies': ['error', { 'devDependencies': true }],
// Allow mongo id fields
'no-underscore-dangle': ['error', { 'allow': ['_id'] }],
// Allow functions to be defined anywhere
'no-use-before-define': ['error', { 'functions': false, 'classes': true, 'variables': true }],
'padding-line-between-statements': [
'error',
{
'blankLine': 'always',
'prev': ['block', 'block-like', 'cjs-export', 'class', 'export', 'import'],
'next': '*'
},
{ 'blankLine': 'any', 'prev': ['export', 'import'], 'next': ['export', 'import'] }
],
// Allow not to destructure an object when assigning to an already existing variable
'prefer-destructuring': [
'error',
{
'VariableDeclarator': { 'array': true, 'object': true },
'AssignmentExpression': { 'array': true, 'object': false }
},
{ enforceForRenamedProperties: false, }
],
'lodash/import-scope': ['error', 'method'],
'lodash/prefer-compact': 'error',
'lodash/prefer-immutable-method': 'error',
'lodash/prefer-is-nil': 'error',
'lodash/prefer-lodash-typecheck': 'error',
'lodash/prefer-noop': 'error',
}
}
142 changes: 0 additions & 142 deletions index.js

This file was deleted.

39 changes: 39 additions & 0 deletions jest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
plugins: [
'jest',
'jest-formatting'
],
extends: [
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:jest-formatting/recommended'
],
env: {
'jest/globals': false
},
rules: {
// Allow padding before beforeAll and beforeEach blocks as we often declare variables there to be initialised within the block
'jest-formatting/padding-around-before-all-blocks': 'off',
'jest-formatting/padding-around-before-each-blocks': 'off'
},
overrides: [
{
files: [
'setupTests.js',
'test-setup-*.browser.js',
'**/*.spec.js',
'**/__mocks__/**',
'**/__test_helpers__/**',
'**/__tests__/**',
'**/__TESTS__/**'
],
env: {
'jest/globals': true
},
rules: {
// Allow inline require() when using doMock conventions
'global-require': 'off',
}
}
]
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@
"eslint-config-airbnb": "18.0.1",
"eslint-config-airbnb-base": "14.0.0",
"eslint-config-prettier": "6.1.0",
"eslint-plugin-ava": "4.5.x",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jest": "22.15.2",
"eslint-plugin-jest-formatting": "1.1.0",
6 changes: 6 additions & 0 deletions react-hooks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: [
'@heed/heed/react',
'airbnb/hooks'
],
}
19 changes: 19 additions & 0 deletions react-native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
plugins: ['react-native'],
extends: [
'@heed/heed/react'
],
rules: {
// Asset requiring uses inline require() calls
'global-require': 'off',
// Primarily for StyleSheet definitions since the convention is to define them after the component
'no-use-before-define': ['error', { 'functions': true, 'classes': true, 'variables': false }],
'react/jsx-filename-extension': ['error', { 'extensions': ['.js', '.jsx'] }],
'react-native/no-unused-styles': 'error',
'react-native/no-inline-styles': 'error',
'react-native/no-color-literals': 'error',
},
env: {
'react-native/react-native': true
},
}
26 changes: 26 additions & 0 deletions react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
extends: [
'airbnb',
'@heed/heed/base',
'prettier/react',
],
env: {
'browser': true
},
rules: {
// Allows custom prop type declarations and hoisting common prop types into other variables
'react/no-typos': 'off',
// allow usage of tagged templates such as injectGlobal from styled-components
'no-unused-expressions': ['error', { 'allowTaggedTemplates': true }],
// allow the unsafe lifecycle methods prefixed with UNSAFE_
'camelcase': ['error', { properties: 'never', ignoreDestructuring: false, allow: ['^UNSAFE_'] }],
// allow spreading jsx props when being used within a hoc
'react/jsx-props-no-spreading': ['error', { 'html': 'enforce', 'custom': 'enforce', 'exceptions': ['WrappedComponent', 'IntegrationWrapper'] }],
},
settings: {
react: {
pragma: 'React',
version: 'detect'
}
},
}
6 changes: 6 additions & 0 deletions recommended.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: [
'airbnb-base',
'@heed/heed/base'
],
}
Loading

0 comments on commit e3d6552

Please sign in to comment.