Skip to content

Commit

Permalink
Merge pull request #1 from algoan/feat/add-react-eslint-config
Browse files Browse the repository at this point in the history
feat: define eslint configuration for React TypeScript projects
  • Loading branch information
amarlankri authored Nov 10, 2020
2 parents 23827d3 + 0befa81 commit e2da39a
Show file tree
Hide file tree
Showing 10 changed files with 9,311 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
workflows:
version: 2
test-publish:
jobs:
- publish:
context: semantic_release
filters:
branches:
only: master



imageA: &defaults
working_directory: ~/tmp
docker:
- image: circleci/node:lts

jobs:
publish:
<<: *defaults
steps:
- checkout
- run:
name: Install dependencies
command: npm ci
- run:
name: Publish package
command: npm run semantic-release
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
.DS_Store
.nyc_output/
coverage/
creds.json
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.circleci/
.releaserc.json
13 changes: 13 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
["@semantic-release/git", {
"assets": ["package.json", "package-lock.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
],
"preset": "angular"
}
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
# react-eslint-config
ESLint configuration file for TypeScript and React projects
<p align="center">
<a href="http://algoan.com/" target="blank"><img src="https://media.licdn.com/dms/image/C4E0BAQH-hIlc5g9g7w/company-logo_200_200/0?e=2159024400&v=beta&t=j5y9KO1P22GsMx3vBNawrpvyvjD2iyBWGeVPUsRkn5s" width="320" alt="Algoan Logo" /></a>
</p>

# Algoan React ESLint config

Algoan [ESLint](https://eslint.org) configuration shared for [React](https://reactjs.org/) projects written in [TypeScript](https://www.typescriptlang.org/) and using [prettier](https://prettier.io/).

## Installation

First, install this module running:

```bash
npm install @algoan/eslint-config-react --save-dev
```

Then, create a `.eslintrc.json` file:

```json
{
"extends": "@algoan/eslint-config"
}
```

## Usage

In your `package.json` file, add a script:

```json
{
"lint": "eslint **/*.{js,jsx,ts,tsx}"
}
```
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
}
29 changes: 29 additions & 0 deletions eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:react-hooks/recommended"
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"@typescript-eslint/explicit-function-return-type": [
"warn",
{ "allowExpressions": true }
],
"react/prop-types": "off"
},
"settings": {
"react": {
"version": "detect"
}
}
}
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./eslintrc.json');
Loading

0 comments on commit e2da39a

Please sign in to comment.