@open-turo/eslint-config-react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ extends:
2
+ - "@open-turo/commitlint-config-conventional"
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ commit-message:
8
+ prefix: build(deps)
9
+ prefix-development: build(dev-deps)
10
+ include: scope
@@ -0,0 +1,19 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+
6
+ jobs:
7
+ lint:
8
+ name: Lint
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ with:
13
+ fetch-depth: 0
14
+ - uses: wagoid/commitlint-github-action@v4
15
+ - uses: actions/setup-python@v2
16
+ - uses: KeisukeYamashita/setup-release@v1.0.2
17
+ with:
18
+ repository: rhysd/actionlint
19
+ - uses: pre-commit/action@v2.0.0
@@ -0,0 +1,23 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+ - next
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ with:
14
+ fetch-depth: 0
15
+ - name: Semantic Release
16
+ id: release
17
+ uses: cycjimmy/semantic-release-action@v2
18
+ with:
19
+ extra_plugins: |
20
+ semantic-release-github-pullrequest
21
+ env:
22
+ GITHUB_TOKEN: ${{ secrets.OPEN_TURO_GITHUB_TOKEN }}
23
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ lts/gallium
@@ -0,0 +1,23 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.1.0
4
+ hooks:
5
+ - id: check-json
6
+ - id: check-yaml
7
+ - id: end-of-file-fixer
8
+ - id: trailing-whitespace
9
+ - repo: https://github.com/pre-commit/mirrors-prettier
10
+ rev: v2.5.1
11
+ hooks:
12
+ - id: prettier
13
+ stages: [commit]
14
+ - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
15
+ rev: v8.0.0
16
+ hooks:
17
+ - id: commitlint
18
+ stages: [commit-msg]
19
+ additional_dependencies: ["@open-turo/commitlint-config-conventional"]
20
+ - repo: https://github.com/rhysd/actionlint
21
+ rev: v1.6.8
22
+ hooks:
23
+ - id: actionlint
@@ -0,0 +1,26 @@
1
+ {
2
+ "branches": ["main", "next"],
3
+ "plugins": [
4
+ "@semantic-release/commit-analyzer",
5
+ "@semantic-release/release-notes-generator",
6
+ [
7
+ "@semantic-release/npm",
8
+ {
9
+ "tarballDir": "pack"
10
+ }
11
+ ],
12
+ [
13
+ "@semantic-release/github",
14
+ {
15
+ "assets": "pack/*.tgz"
16
+ }
17
+ ],
18
+ [
19
+ "semantic-release-github-pullrequest",
20
+ {
21
+ "assets": ["package.json", "README.md", "package-lock.json"],
22
+ "baseRef": "main"
23
+ }
24
+ ]
25
+ ]
26
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Turo Open Source
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # `@open-turo/eslint-config-react`
2
+
3
+ Turo eslint configuration for react. The config expects that Typescript is being used.
4
+
5
+ ## Usage
6
+
7
+ Install the package and all of its peer dependencies:
8
+
9
+ ```shell
10
+ npx install-peerdeps --dev @open-turo/eslint-config-react
11
+ ```
12
+
13
+ Then in your `.eslintrc` file add:
14
+
15
+ ```
16
+ "extends": "@open-turo/eslint-config-react"
17
+ ```
18
+
19
+ ## Development
20
+
21
+ Install [pre-commit](https://pre-commit.com/) and the commit hooks:
22
+
23
+ ```shell
24
+ pre-commit install
25
+ pre-commit install --hook-type commit-msg
26
+ ```
27
+
28
+ ## Get Help
29
+
30
+ Please review Issues, post new Issues against this repository as needed.
31
+
32
+ ## Contributions
33
+
34
+ Please see [here](https://github.com/open-turo/contributions) for guidelines on how to contribute to this project.
package/index.js ADDED
@@ -0,0 +1,46 @@
1
+ module.exports = {
2
+ parser: "@typescript-eslint/parser",
3
+ plugins: ["react", "react-hooks", "jsx-a11y"],
4
+ extends: [
5
+ "plugin:react/recommended",
6
+ "plugin:react-hooks/recommended",
7
+ "plugin:jsx-a11y/recommended",
8
+ ],
9
+ parserOptions: {
10
+ ecmaVersion: 2022,
11
+ sourceType: "module",
12
+ ecmaFeatures: {
13
+ jsx: true,
14
+ },
15
+ },
16
+ rules: {
17
+ rules: {
18
+ "jsx-a11y/anchor-is-valid": [
19
+ "warn",
20
+ {
21
+ specialLink: ["to"],
22
+ },
23
+ ],
24
+ // don't force .jsx extension
25
+ "react/jsx-filename-extension": "off",
26
+ // In TS you must use the Fragment syntax instead of the shorthand
27
+ "react/jsx-fragments": "off",
28
+ // This allows props to be spread in JSX
29
+ "react/jsx-props-no-spreading": "off",
30
+ // ensure props are alphabetical
31
+ "react/jsx-sort-props": "error",
32
+ // We don't need default props on TS components
33
+ "react/require-default-props": "off",
34
+ "react/sort-prop-types": "error",
35
+ // State initialization can be in the constructor or via class fields
36
+ "react/state-in-constructor": "off",
37
+ // This allows static properties to be placed within the class declaration
38
+ "react/static-property-placement": "off",
39
+ },
40
+ },
41
+ settings: {
42
+ react: {
43
+ version: "detect",
44
+ },
45
+ },
46
+ };
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "author": "Turo engineering",
3
+ "description": "Turo eslint configuration for react",
4
+ "devDependencies": {
5
+ "@commitlint/cli": "^17.0.0",
6
+ "@open-turo/commitlint-config-conventional": "^1.0.2",
7
+ "@semantic-release/git": "^10.0.1",
8
+ "@typescript-eslint/eslint-plugin": "^5.20.0",
9
+ "@typescript-eslint/parser": "^5.20.0",
10
+ "eslint": "^8.16.0",
11
+ "eslint-plugin-jsx-a11y": "^6.5.1",
12
+ "eslint-plugin-react": "^7.29.4",
13
+ "eslint-plugin-react-hooks": "^4.4.0",
14
+ "semantic-release": "^19.0.2",
15
+ "semantic-release-github-pullrequest": "^1.3.0"
16
+ },
17
+ "engines": {
18
+ "node": ">= 14"
19
+ },
20
+ "homepage": "https://github.com/open-turo/eslint-config-react#readme",
21
+ "license": "MIT",
22
+ "main": "index.js",
23
+ "name": "@open-turo/eslint-config-react",
24
+ "peerDependencies": {
25
+ "@typescript-eslint/eslint-plugin": "^5.20.0",
26
+ "@typescript-eslint/parser": "^5.20.0",
27
+ "eslint": ">=8.16.0",
28
+ "eslint-plugin-jsx-a11y": "^6.5.1",
29
+ "eslint-plugin-react": "^7.29.4",
30
+ "eslint-plugin-react-hooks": "^4.4.0"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "repository": "https://github.com/open-turo/eslint-config-react",
36
+ "version": "1.0.0"
37
+ }