Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

Commit

Permalink
add eslint configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Ivantsov committed Oct 18, 2016
1 parent c074fbc commit d16b56c
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 1 deletion.
69 changes: 69 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
const INDENT = 4;

module.exports = {
extends: 'airbnb',
env: {
webextensions: true,
browser: true
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
ecmaFeatures: {
experimentalObjectRestSpread: true
}
},
settings: {
'import/resolver': {
webpack: {
config: './webpack/dev.js'
}
}
},
rules: {
indent: ['error', INDENT, {
SwitchCase: 1
}],
'linebreak-style': 'off',
'comma-dangle': ['error', 'never'],
'brace-style': ['error', 'stroustrup', {
'allowSingleLine': false
}],
'object-curly-spacing': ['error', 'never'],
'no-unused-expressions': ['error', {
allowShortCircuit: true,
allowTernary: true
}],
'max-len': 'off',
'no-param-reassign': 'off',
'one-var': ['error', {
initialized: 'never'
}],
'one-var-declaration-per-line': ['error', 'initializations'],
'arrow-parens': 'off',

'react/jsx-filename-extension': ['error', {extensions: ['.js']}],
'react/jsx-indent': ['error', INDENT],
'react/jsx-indent-props': ['error', INDENT],
'react/jsx-space-before-closing': ['error', 'never'],
'react/forbid-prop-types': 'off',
'react/no-unused-prop-types': ['error', {
skipShapeProps: true
}],
'react/sort-comp': ['error', {
order: [
'static-methods',
'lifecycle',
'/^render.+$/',
'render',
'/^on.+$/',
'/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
'everything-else'
],
}],


'import/prefer-default-export': 'off',
'jsx-a11y/no-static-element-interactions': 'off'
}
};
10 changes: 10 additions & 0 deletions scripts/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
rules: {
'no-console': 'off',
'import/no-extraneous-dependencies': ['error', {
devDependencies: true,
optionalDependencies: false,
peerDependencies: false
}]
}
};
2 changes: 1 addition & 1 deletion src/pages/shared/utils/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function parseDate(value) {
}

function date(value) {
const date = parseDate(value);
const date = parseDate(value); // eslint-disable-line no-shadow
const currentDate = new Date();
let yearPostfix = '';

Expand Down
10 changes: 10 additions & 0 deletions webpack/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
rules: {
'no-console': 'off',
'import/no-extraneous-dependencies': ['error', {
devDependencies: true,
optionalDependencies: false,
peerDependencies: false
}]
}
};

0 comments on commit d16b56c

Please sign in to comment.