Skip to content

Commit

Permalink
Merge pull request #18 from molindo/add-more-rules
Browse files Browse the repository at this point in the history
Add more rules
  • Loading branch information
amannn authored Jan 16, 2019
2 parents b089809 + 708a4f0 commit 550be0d
Show file tree
Hide file tree
Showing 5 changed files with 1,333 additions and 1,949 deletions.
7 changes: 7 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
testFiles: [
'**/__testUtils__/**/*.{js,jsx,ts,tsx}',
'**/__tests__/**/*.{js,jsx,ts,tsx}',
'**/*.{spec,test}.{js,jsx,ts,tsx}'
]
};
17 changes: 9 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const config = require('./config');

const ERROR = 'error';
const OFF = 'off';

module.exports = {
parser: 'babel-eslint',

plugins: ['import', 'import-order-autofix', 'prettier'],
plugins: ['import', 'prettier'],

settings: {
'import/resolver': 'node'
Expand All @@ -19,22 +21,18 @@ module.exports = {
rules: {
'arrow-body-style': [ERROR, 'as-needed'],
curly: [ERROR, 'multi-line'],
'dot-notation': ERROR,
eqeqeq: [ERROR, 'always', {null: 'ignore'}],
'import/newline-after-import': ERROR,
'import/no-unresolved': [ERROR, {commonjs: true}],
'import/no-named-as-default': OFF,
'import/no-extraneous-dependencies': [
ERROR,
{
devDependencies: [
'webpack.config.js',
'**/__testUtils__/**/*.js',
'**/__tests__/*-test.js'
]
devDependencies: config.testFiles.concat('webpack.config.js')
}
],
'import/order': OFF,
'import-order-autofix/order': [
'import/order': [
ERROR,
{
groups: [
Expand All @@ -48,8 +46,11 @@ module.exports = {
'newlines-between': 'never'
}
],
'no-lonely-if': ERROR,
'no-throw-literal': ERROR,
'no-var': ERROR,
'no-unneeded-ternary': ERROR,
'no-unused-expressions': ERROR,
'no-restricted-syntax': [
ERROR,
{
Expand Down
33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-molindo",
"version": "2.0.0",
"version": "3.0.0",
"description": "Molindo ESLint config that implements our styleguide and helps to catch errors.",
"main": "index.js",
"repository": "https://github.com/molindo/eslint-config-molindo",
Expand All @@ -17,26 +17,25 @@
},
"files": [
"index.js",
"config.js",
"react.js"
],
"devDependencies": {
"babel-eslint": "8.0.2",
"eslint": "4.12.1",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-import-order-autofix": "0.8.3",
"eslint-plugin-prettier": "2.3.1",
"jest": "21.2.1",
"prettier": "1.8.2"
"babel-eslint": "10.0.1",
"eslint": "5.12.0",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-prettier": "3.0.1",
"jest": "23.6.0",
"prettier": "1.15.3"
},
"peerDependencies": {
"babel-eslint": "^8.0.2",
"eslint": "^4.12.1",
"eslint-plugin-css-modules": "^2.7.5",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-import-order-autofix": "^0.8.3",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-prettier": "^2.2.0",
"eslint-plugin-react": "^7.5.1",
"prettier": "^1.8.2"
"babel-eslint": "^10.0.0",
"eslint": "^5.12.0",
"eslint-plugin-css-modules": "^2.11.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.3",
"prettier": "^1.15.3"
}
}
3 changes: 2 additions & 1 deletion react.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const config = require('./config');
const base = require('./index');

const ERROR = 'error';
Expand Down Expand Up @@ -69,7 +70,7 @@ module.exports = Object.assign({}, base, {
}),

overrides: (base.overrides || []).concat({
files: ['src/**/__tests__/*-test.js'],
files: config.testFiles,
rules: {
'css-modules/no-unused-class': OFF,
'react/prop-types': OFF,
Expand Down
Loading

0 comments on commit 550be0d

Please sign in to comment.