Skip to content

Commit

Permalink
Add @herp-inc/eslint-config-jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-ka committed Feb 9, 2022
1 parent a08f4f7 commit d0e1b23
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ A monorepo for [ESLint shareable configs](https://eslint.org/docs/developer-guid
| -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [`@herp-inc/eslint-config`](https://github.com/herp-inc/eslint-config/tree/master/base) | [![npm](https://img.shields.io/npm/v/@herp-inc/eslint-config)](https://www.npmjs.com/package/@herp-inc/eslint-config) | [TypeScript](https://www.typescriptlang.org/) environments |
| [`@herp-inc/eslint-config-jest`](https://github.com/herp-inc/eslint-config/tree/master/jest) | [![npm](https://img.shields.io/npm/v/@herp-inc/eslint-config-jest)](https://www.npmjs.com/package/@herp-inc/eslint-config-jest) | [Jest](https://jestjs.io/) environments |
| [`@herp-inc/eslint-config-jsx`](https://github.com/herp-inc/eslint-config/tree/master/jsx) | [![npm](https://img.shields.io/npm/v/@herp-inc/eslint-config-jsx)](https://www.npmjs.com/package/@herp-inc/eslint-config-jsx) | [JSX](https://facebook.github.io/jsx/) environments |
| [`@herp-inc/eslint-config-node`](https://github.com/herp-inc/eslint-config/tree/master/node) | [![npm](https://img.shields.io/npm/v/@herp-inc/eslint-config-node)](https://www.npmjs.com/package/@herp-inc/eslint-config-node) | [Node.js](https://nodejs.org/en/) environments |

## Lisence
Expand Down
5 changes: 5 additions & 0 deletions jsx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change log

## v0.1.0

- Initial release
43 changes: 43 additions & 0 deletions jsx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# `@herp-inc/eslint-config-jsx` [![npm](https://img.shields.io/npm/v/@herp-inc/eslint-config-jsx)](https://www.npmjs.com/package/@herp-inc/eslint-config-jsx)

[ESLint shareable config](https://eslint.org/docs/developer-guide/shareable-configs) for [JSX](https://facebook.github.io/jsx/) environments

This package is intended to be used along with [`@herp-inc/eslint-config`](https://www.npmjs.com/package/@herp-inc/eslint-config).

## Installation

Note that the following packages are peer dependencies of this library, which need to be installed separately.

| Package | Version |
| -------------------------------------------------------------------------------- | --------- |
| [`eslint`](https://www.npmjs.com/package/eslint) | `8` |
| [`eslint-plugin-jsx-a11y`](https://www.npmjs.com/package/eslint-plugin-jsx-a11y) | `^6.5.0` |
| [`eslint-plugin-react`](https://www.npmjs.com/package/eslint-plugin-react) | `^7.27.0` |

### Using [npm](https://www.npmjs.com/)

```sh
$ npm install --save-dev @herp-inc/eslint-config-jsx
```

### Using [yarn](https://yarnpkg.com/)

```sh
$ yarn add --dev @herp-inc/eslint-config-jsx
```

## Usage

Add `@herp-inc/eslint-config-jsx` to the `extends` section of your [ESLint configuration](http://eslint.org/docs/user-guide/configuring).

```json
{
"extends": ["@herp-inc"],
"overrides": [
{
"extends": ["@herp-inc/eslint-config-jsx"],
"files": ["*.tsx"]
}
]
}
```
9 changes: 9 additions & 0 deletions jsx/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
extends: ['plugin:jsx-a11y/recommended'],
plugins: ['jsx-a11y', 'react'],
rules: {
'react/button-has-type': 'error',
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-useless-fragment': 'error',
},
};
26 changes: 26 additions & 0 deletions jsx/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@herp-inc/eslint-config-jsx",
"version": "0.1.0",
"description": "ESLint shareable config for JSX environments",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/herp-inc/eslint-config"
},
"keywords": [
"eslint",
"eslintconfig",
"jsx"
],
"author": "HERP, Inc.",
"license": "MIT",
"bugs": {
"url": "https://github.com/herp-inc/eslint-config/issues"
},
"homepage": "https://github.com/herp-inc/eslint-config",
"peerDependencies": {
"eslint": "8",
"eslint-plugin-jsx-a11y": "^6.5.0",
"eslint-plugin-react": "^7.27.0"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"workspaces": [
"base",
"jest",
"jsx",
"node"
],
"devDependencies": {
Expand Down

0 comments on commit d0e1b23

Please sign in to comment.