Skip to content

Commit

Permalink
Initial commit of the Leviy javascript styleguide including a default…
Browse files Browse the repository at this point in the history
… ESLint config
  • Loading branch information
denniscoorn committed Jun 11, 2018
0 parents commit 5dd544b
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea/
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Leviy Javascript Styleguide

In order to effectively apply the Leviy Javascript Styleguide in your project it's
highly recommended to use the tools listed. These tools can easily be added to your project by
installing the corresponding `@leviy/*-preset-default` or `@leviy/*-config-default` packages
including their peer dependencies. Check the `README` for each of the package to read
how you can install and use it.

## Tools

__ESLint__ [@leviy/eslint-config-default](https://github.com/leviy/javascript-coding-standard/tree/master/packages/eslint-config-default/)

__Babel__ [@leviy/babel-preset-default](https://github.com/leviy/babel-preset-default/)

__Webpack__ [@leviy/webpack-config-default](https://github.com/leviy/webpack-config-default/)

__Jest__ [@leviy/jest-preset-default](https://github.com/leviy/jest-preset-default/)
21 changes: 21 additions & 0 deletions packages/eslint-config-default/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @leviy/eslint-config-default

Default [ESLint](https://eslint.org) config for Leviy development.

## Installation

Install the module including it's peer dependencies:

```bash
npx install-peerdeps @leviy/eslint-config-default --dev
```

## Usage

#### Via `.eslintrc`

```js
module.exports = {
extends: '@leviy/eslint-config-default',
};
```
28 changes: 28 additions & 0 deletions packages/eslint-config-default/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
extends: 'airbnb-base',
env: {
'browser': true,
'jquery': true,
'jest/globals': true
},
plugins: ['jest'],
rules: {
'import/first': 'off',
'import/no-extraneous-dependencies': ['error', {
'devDependencies': true
}],
'arrow-body-style': 'off',
'class-methods-use-this': 'off',
'max-len': [2, 140, 4],
'indent': ['error', 4],
'no-continue': 'off',
'no-prototype-builtins': 'off',
'no-underscore-dangle': ['error', {
'allowAfterThis': true
}],
'object-shorthand': ['error', 'never'],
'prefer-destructuring': ['error', {
'array': false
}]
}
};
17 changes: 17 additions & 0 deletions packages/eslint-config-default/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@leviy/eslint-config-default",
"version": "1.0.0",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]:leviy/javascript-coding-standard.git"
},
"homepage": "https://github.com/leviy/javascript-coding-standard/tree/master/packages/eslint-config-default/",
"dependencies": {
"eslint-config-airbnb-base": "^12.1",
"eslint-plugin-jest": "^21.15"
},
"peerDependencies": {
"eslint": "^4.19",
"eslint-plugin-import": "^2.11"
}
}

0 comments on commit 5dd544b

Please sign in to comment.