Skip to content

Commit

Permalink
chore: added new linter config (#1028)
Browse files Browse the repository at this point in the history
* chore: added new linter config

* chore: linting fixes

* chore: refactore in linting config and minor linting fixes
  • Loading branch information
anikethsaha committed Feb 20, 2020
1 parent a111df9 commit 75c72e9
Show file tree
Hide file tree
Showing 61 changed files with 2,600 additions and 1,808 deletions.
6 changes: 5 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ node_modules
build
server.js
cypress
lib
lib
themes
build
docs/
**/*.md
34 changes: 0 additions & 34 deletions .eslintrc

This file was deleted.

63 changes: 63 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2019,
},
env: {
jest: true,
browser: true,
node: true,
es6: true,
},
plugins: ['prettier', 'import'],
extends: ['eslint:recommended', 'plugin:import/recommended'],
settings: {
'import/ignore': ['node_modules', '.json$'],
},
rules: {
'prettier/prettier': ['error'],
camelcase: ['warn'],
curly: ['error', 'all'],
'dot-notation': ['error'],
eqeqeq: ['error'],
'handle-callback-err': ['error'],
'new-cap': ['error'],
'no-alert': ['error'],
'no-caller': ['error'],
'no-eval': ['error'],
'no-labels': ['error'],
'no-lonely-if': ['error'],
'no-new': ['error'],
'no-proto': ['error'],
'no-return-assign': ['error'],
'no-self-compare': ['error'],
'no-shadow': ['warn'],
'no-shadow-restricted-names': ['error'],
'no-useless-call': ['error'],
'no-var': ['error'],
'no-void': ['error'],
'no-with': ['error'],
radix: ['error'],
'spaced-comment': ['error', 'always'],
strict: ['error', 'global'],
yoda: ['error', 'never'],

// Import rules
// Search way how integrate with `lerna`
'import/no-unresolved': 'off',
'import/imports-first': ['error'],
'import/newline-after-import': ['error'],
'import/no-duplicates': ['error'],
'import/no-mutable-exports': ['error'],
'import/no-named-as-default': ['error'],
'import/no-named-as-default-member': ['error'],
'import/order': ['warn'],
},
globals: {
Docsify: 'writable',
$docsify: 'writable',
dom: 'writable',
},
};
4 changes: 4 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
singleQuote: true,
trailingComma: 'es5',
};
Loading

0 comments on commit 75c72e9

Please sign in to comment.