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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Stricter linters #81

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 94 additions & 31 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,46 @@

const fs = require('fs');
const path = require('path');


const prettierOptions = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '.prettierrc'), 'utf8'),
);

// const app = JSON.parse(path.resolve(__dirname, 'app'));

module.exports = {
root: true,
parser: 'babel-eslint',
extends: ['airbnb', 'prettier', 'prettier/react'],
plugins: ['prettier', 'redux-saga', 'react-native', 'react', 'react-hooks', 'jsx-a11y'],
extends: [
'airbnb',
'prettier',
'prettier/react',
'plugin:prettier/recommended',
'plugin:sonarjs/recommended',
'plugin:security/recommended-legacy',
'plugin:fp/recommended'
],
plugins: [
'github',
'immutable',
'sonarjs',
'prettier',
'redux-saga',
'react-native',
'react',
'react-hooks',
'jsx-a11y',
'fp'
],
env: {
jest: true,
browser: true,
node: true,
es6: true,
es6: true
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
jsx: true
}
},
rules: {
'prettier/prettier': ['error', prettierOptions],
Expand Down Expand Up @@ -53,8 +69,8 @@ module.exports = {
// NOTE: If this error triggers, either disable it or add
// your custom components, labels and attributes via these options
// See https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-associated-control.md
controlComponents: ['Input'],
},
controlComponents: ['Input']
}
],
'jsx-a11y/label-has-for': 0,
'jsx-a11y/mouse-events-have-key-events': 2,
Expand Down Expand Up @@ -82,29 +98,76 @@ module.exports = {
'redux-saga/no-yield-in-race': 2,
'redux-saga/yield-effects': 2,
'require-yield': 0,
'react/no-array-index-key': 0
'react/no-array-index-key': 0,
'react/jsx-curly-newline': 0,
'react/jsx-one-expression-per-line': 0,
'react/jsx-wrap-multilines': 0,
'react/no-unused-prop-types': 0,
'max-lines-per-function': ['error', 250],
'no-else-return': 'error',
'max-params': ['error', 3],
'require-jsdoc': [
'error',
{
require: {
FunctionDeclaration: true,
MethodDefinition: false,
ClassDeclaration: false,
ArrowFunctionExpression: false,
FunctionExpression: false
}
}
],
'no-shadow': 'error',
complexity: ['error', 10],
'no-empty': 'error',
'import/order': [
'error',
{
groups: [
['builtin', 'external', 'internal', 'parent', 'sibling', 'index']
]
}
],
'immutable/no-let': 2,
'immutable/no-this': 2,
'max-lines': ['error', 350],
'react-native/no-unused-styles': 2,
'react-native/split-platform-components': 2,
'react-native/no-inline-styles': 2,
'react-native/no-color-literals': 2,
'react-native/no-raw-text': 2,
'react-native/no-single-element-style-arrays': 2,
'fp/no-mutation': [
'error',
{
exceptions: [{ property: 'propTypes' }, { property: 'defaultProps' }]
}
],
'fp/no-nil': 0,
'fp/no-unused-expression': 0
},
"settings": {
"import/resolver": {
"node": {
"app": "./app",
"context": "app",
"resolve": {
"alias": {
"@assets": "./app/assets",
"@components": "./app/components",
"@containers": "./app/containers",
"@config": "./app/config",
"@navigators": "./app/navigators",
"@services": "./app/services",
"@themes": "./app/themes",
"@utils": "./app/utils"
settings: {
'import/resolver': {
node: {
app: './app',
context: 'app',
resolve: {
alias: {
'@assets': './app/assets',
'@components': './app/components',
'@containers': './app/containers',
'@config': './app/config',
'@navigators': './app/navigators',
'@services': './app/services',
'@themes': './app/themes',
'@utils': './app/utils'
},
"paths": ["app"],
"modules": ["app", 'node_modules'],
"extensions": ['.js', '.jsx', '.json', '.coffee', '.cjsx'],
paths: ['app'],
modules: ['app', 'node_modules'],
extensions: ['.js', '.jsx', '.json', '.coffee', '.cjsx']
}
}
}
}
}
};
Loading