Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ryota-murakami committed Jun 3, 2022
0 parents commit acad772
Show file tree
Hide file tree
Showing 12 changed files with 1,810 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '18.1.0'
- run: yarn install
- run: yarn lint
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.DS_Store
.idea
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.gitignore
CONTRIBUTING.md
.github
yarn-error.log
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
coverage
dist
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"semi": false
}
31 changes: 31 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people
who contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, or religion.

Examples of unacceptable behavior by participants include the use of sexual
language or imagery, derogatory comments or personal attacks, trolling, public
or private harassment, insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct. Project maintainers who do not follow the
Code of Conduct may be removed from the project team.

This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by opening an issue or contacting one or more of the project
maintainers.

This Code of Conduct is adapted from the
[Contributor Covenant](http://contributor-covenant.org), version 1.1.0,
available at
[http://contributor-covenant.org/version/1/1/0/](http://contributor-covenant.org/version/1/1/0/)
59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Contributing

Thanks for being willing to contribute!

**Working on your first Pull Request?** You can learn how from this _free_
series [How to Contribute to an Open Source Project on GitHub][egghead]

## Project setup

1. Fork and clone the repo
2. `$ npm install` to install dependencies
3. `$ npm run validate` to validate you've got it working
4. Create a branch for your PR

> Tip: Keep your `master` branch pointing at the original repository and make
> pull requests from branches on your fork. To do this, run:
>
> ```
> git remote add upstream https://github.com/kentcdodds/eslint-config-kentcdodds.git
> git fetch upstream
> git branch --set-upstream-to=upstream/master master
> ```
>
> This will add the original repository as a "remote" called "upstream," Then
> fetch the git information from that remote, then set your local `master`
> branch to use the upstream master branch whenever you run `git pull`. Then you
> can make all of your pull request branches based on this `master` branch.
> Whenever you want to update your version of `master`, do a regular `git pull`.
## Add yourself as a contributor

This project follows the [all contributors][all-contributors] specification. To
add yourself to the table of contributors on the `README.md`, please use the
automated script as part of your PR:

```console
npm run add-contributor
```

Follow the prompt and commit `.all-contributorsrc` and `README.md` in the PR. If
you've already added yourself to the list and are making a new type of
contribution, you can run it again and select the added contribution type.

## Committing and Pushing changes

Please make sure to run the tests before you commit your changes. You can run
`npm run test:update` which will update any snapshots that need updating. Make
sure to include those changes (if they exist) in your commit.

## Help needed

Please checkout the [the open issues][issues]

Also, please watch the repo and respond to questions/bug reports/feature
requests! Thanks!

[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
[all-contributors]: https://github.com/kentcdodds/all-contributors
[issues]: https://github.com/kentcdodds/eslint-config-kentcdodds/issues
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<div align="center">
<h1>eslint-beautiful-config-react-typescript-pro</h1>

<p>ESLint rules for all of my React + TypesScript projects. Feel free to use these conventions :-)</p>
</div>

---

## Installation

This module is distributed via npm which is bundled with node and
should be installed as one of your project's `devDependencies`:

```
npm install --save-dev eslint-config-typescript-react-pro-beautiful eslint-plugin-prettier
```

This library has a required `peerDependencies` for TypeScirpt

## Usage

Add the extends to your `.eslintrc.js` or `.eslintrc.json` or `.eslintrc`:

```json
{
"extends": "eslint-beautiful-config-react-typescript-pro"
}
```

And need `.prettierrc` file because this package refers your `.prettierrc` and use directly.
If you don't have `.prettierrc`, please `touch .prettierrc` and set prettier rules depends on your preferece like this.

```json
{
"singleQuote": true,
"semi": false
}
```

## LICENSE

MIT
87 changes: 87 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
node: true,
},
extends: ['plugin:jsx-a11y/recommended'],
globals: {
JSX: 'readonly',
},
parser: '@typescript-eslint/parser',
plugins: [
'jsx-a11y',
'import',
'sort-keys-fix',
'react-hooks',
'@typescript-eslint',
'prettier',
],
root: true,
rules: {
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/prefer-as-const': 'warn',
'import/default': 'error',
'import/dynamic-import-chunkname': 'error',
'import/export': 'error',
'import/named': 'error',
'import/no-anonymous-default-export': 'off',
'import/no-duplicates': 'error',
'import/no-named-as-default': 'error',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': 'error',
'import/order': [
'warn',
{
alphabetize: {
caseInsensitive: true,
order: 'asc',
},
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
],
'newlines-between': 'always',
},
],
'no-alert': 'error',
'no-console': 'error',
'no-dupe-keys': 'error',
'no-unused-private-class-members': 'error',
'prettier/prettier': [
'warn',
{},
{
properties: {
usePrettierrc: true,
},
},
],
'react-hooks/rules-of-hooks': 'error',
'sort-keys-fix/sort-keys-fix': 'warn',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {
alwaysTryTypes: true,
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
project: ['tsconfig.json'],
},
},
react: {
version: 'detect',
},
},
}
50 changes: 50 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "eslint-config-typescript-react-pro-beautiful",
"version": "0.0.0",
"description": "ESLint rules that specialized specialized for React + TypeScript",
"main": "index.js",
"scripts": {
"lint": "eslint index.js",
"prettier": "prettier --write \"**/*.+(json|yml|css|md|mdx)\""
},
"repository": {
"type": "git",
"url": "https://github.com/laststance/eslint-config-react-typescript-pro-beautiful"
},
"author": "Ryota Murakami <dojce1048@gmail.com> (https://ryota-murakami.github.io/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/laststance/eslint-config-react-typescript-pro-beautiful/issues"
},
"homepage": "https://github.com/laststance/eslint-config-react-typescript-pro-beautiful",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-sort-keys-fix": "^1.1.2",
"prettier": "^2.6.2"
},
"devDependencies": {
"typescript": "^4.7.2"
},
"peerDependencies": {
"typescript": "^4.0.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},
"eslintConfig": {
"extends": "./index.js"
},
"eslintIgnore": [
"node_modules"
]
}
Loading

0 comments on commit acad772

Please sign in to comment.