Skip to content

Commit

Permalink
Merge pull request #2 from SandroMiguel/feature/t179-update-dependencies
Browse files Browse the repository at this point in the history
Feature/t179 update dependencies
  • Loading branch information
SandroMiguel authored Aug 11, 2019
2 parents c81f561 + 634584b commit 1f4ece9
Show file tree
Hide file tree
Showing 9 changed files with 430 additions and 269 deletions.
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: './index.js',
}
25 changes: 21 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
/.idea
/.others
/node_modules
desktop.ini
## Editor directory
**/.idea
**/.vscode

## Ignore NPM 'node_modules' directory
**/node_modules

## Ignore Composer 'vendor' directory
**/vendor

## Ignore log files
**/log
yarn-error.log*

## Ignore generated source maps
*.map

## Other files to ignore (e.g. credentials)
.env
**/storage
**/.others
5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
semi: false,
singleQuote: true,
trailingComma: 'all',
}
51 changes: 40 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The goal of the ESLint config Cecilia is to keep the code clean and consistent.
ESLint config Cecilia rules are based on [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb).

## Table of Contents

1. [Getting Started](#getting-started)
1. [Contributing](#contributing)
1. [Questions](#questions)
Expand All @@ -25,61 +26,89 @@ ESLint config Cecilia rules are based on [eslint-config-airbnb](https://www.npmj
## Getting Started

### Installation

Install ESLint config Cecilia.

#### Step 1 - Install with Yarn

`yarn add eslint-config-cecilia --dev`

##### Or install with npm

`npm install -D eslint-config-cecilia`

### Usage

#### Step 2 - Create a `.eslintrc` file in your project root directory and use the `extends` attribute.
#### Step 2 - Create a `.eslintrc.js` file in your project root directory and use the `extends` attribute.

Paste this code to extend the ESLint ruleset:

```
{
"extends": "cecilia"
module.exports = {
extends: './index.js',
}
```

#### Step 3 - Add scripts to the `package.json` file
#### Step 3 - Create a `.prettierrc.js` file in your project root directory and change some rules.

```
module.exports = {
semi: false,
singleQuote: true,
trailingComma: 'all',
}
```

#### Step 4 - Add scripts to the `package.json` file

Open the `package.json` file and add the following scripts entries:

```
...
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
"lint:fix": "eslint . --fix",
"lint:format": "prettier --write \"./**/*.{js,jsx,json}\""
},
...
```

#### Step 4 - Run the script
#### Step 5 - Run the script

`yarn lint` or `npm run lint` to lint your code.

`yarn lint:fix` or `npm run lint:fix` to lint and fix your code.

`yarn lint:format` or `npm run lint:format` to format your code.

## Credits

- Linting - [ESLint](https://eslint.org/)
- Rules base - [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb)
- Rules base config - [eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb)
- Code formatter config - [Prettier](https://www.npmjs.com/package/prettier)
- Plugin - [eslint-plugin-const-case](https://www.npmjs.com/package/eslint-plugin-const-case)
- Plugin - [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import)
- Plugin - [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react)
- Plugin - [eslint-plugin-jsx-a11y](https://www.npmjs.com/package/eslint-plugin-jsx-a11y)
- Plugin - [eslint-plugin-jsdoc](https://www.npmjs.com/package/eslint-plugin-jsdoc)
- Plugin - [eslint-plugin-const-case](https://www.npmjs.com/package/eslint-plugin-const-case)
- Plugin - [eslint-plugin-jsx-a11y](https://www.npmjs.com/package/eslint-plugin-jsx-a11y)
- Plugin - [eslint-plugin-prettier](https://www.npmjs.com/package/eslint-plugin-prettier)
- Plugin - [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react)
- Plugin - [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
- IDE coding style - [EditorConfig](https://editorconfig.org/)
- Logo gear - made by [Freepik](http://www.freepik.com) from [www.flaticon.com](https://www.flaticon.com/) is
licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/)
licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/)

## Contributing

Want to contribute? All contributions are welcome. Read the [contributing guide](CONTRIBUTING.md).

## Questions

If you have questions tweet me at [@sandro_m_m](https://twitter.com/sandro_m_m) or [open an issue](../../issues/new).

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

**~ sharing is caring ~**
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
extends: './rules/eslintrc_base.js',
};
}
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-cecilia",
"version": "1.2.0",
"version": "1.3.0",
"description": "ESLint configuration for awesome projects",
"main": "index.js",
"scripts": {
Expand All @@ -24,12 +24,16 @@
},
"license": "MIT",
"dependencies": {
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-const-case": "^1.0.4",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-jsdoc": "^7.2.3",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.13.0"
"eslint": "^6.1.0",
"eslint-config-airbnb": "^17.1.1",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-const-case": "^1.2.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsdoc": "^15.8.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"eslint-plugin-react-hooks": "^1.7.0",
"prettier": "^1.18.2"
}
}
51 changes: 28 additions & 23 deletions rules/eslintrc_base.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,45 @@
module.exports = {
extends: 'airbnb',
plugins: [
'const-case',
'jsdoc',
],
extends: ['airbnb', 'prettier', 'prettier/react'],
plugins: ['const-case', 'jsdoc', 'prettier', 'react', 'react-hooks'],
rules: {
// Prettier
'prettier/prettier': ['error'],
// React Hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// Spaces inside of parentheses
'space-in-parens': ['off', 'always'],
// Space before function parenthesis
'space-before-function-paren': ['error', {anonymous: 'ignore', named: 'ignore'}],
'space-before-function-paren': ['error', { anonymous: 'ignore', named: 'ignore' }],
// Consistent spacing between keys and values in object literal properties
'key-spacing': ['off', {
singleLine: {
beforeColon: false,
afterColon: true,
'key-spacing': [
'off',
{
singleLine: {
beforeColon: false,
afterColon: true,
},
multiLine: {
beforeColon: true,
afterColon: true,
align: 'colon',
},
},
multiLine: {
beforeColon: true,
afterColon: true,
align: 'colon',
},
}],
],
// Usage of Spacing in Template Strings
'template-curly-spacing': ['off', 'always'],
// Consistent spacing inside braces
'object-curly-spacing': ['off', 'always'],
// No more than one blank line
'no-multiple-empty-lines': ['error', {max: 1, maxEOF: 0, maxBOF: 0}],
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0, maxBOF: 0 }],
// Limit Cyclomatic Complexity
complexity: ['error', {max: 6}],
complexity: ['error', { max: 6 }],
// Multiple spaces
'no-multi-spaces': ['error', {exceptions: {VariableDeclarator: true}}],
'no-multi-spaces': ['error', { exceptions: { VariableDeclarator: true } }],
// Maximum line length
'max-len': ['error', {code: 120}],
'max-len': ['error', { code: 120 }],
// New line after import
'import/newline-after-import': ['error', {count: 0}],
'import/newline-after-import': ['error', { count: 0 }],
// Dynamic require
'import/no-dynamic-require': 'off',
// Ensures an imported module can be resolved to a module on the local filesystem
Expand Down Expand Up @@ -82,8 +87,8 @@ module.exports = {
// Consistent linebreak style
'linebreak-style': ['error', 'unix'],
// CamelCase
camelcase: ['error', {properties: 'always'}],
camelcase: ['error', { properties: 'always' }],
// Require or disallow semicolons instead of ASI
semi: ['error', 'never'],
},
};
}
Loading

0 comments on commit 1f4ece9

Please sign in to comment.