@etchteam/eslint-config 0.0.1

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.
package/.editorconfig ADDED
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ indent_size = 2
7
+ indent_style = space
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
@@ -0,0 +1,45 @@
1
+ pull_request_rules:
2
+ - name: Merge dependabot PRs when all checks pass
3
+ conditions:
4
+ - and:
5
+ - author~=^dependabot(|-preview)\[bot\]$
6
+ - check-success=SonarCloud Code Analysis
7
+ - check-success~=^security/snyk
8
+ - label!=wontfix
9
+ actions:
10
+ merge:
11
+ method: merge
12
+ - name: Merge Snyk PRs when all checks pass
13
+ conditions:
14
+ - and:
15
+ - title~=^\[Snyk\]
16
+ - head~=^snyk-fix
17
+ - check-success~=^security/snyk
18
+ - check-success=SonarCloud Code Analysis
19
+ - label!=wontfix
20
+ actions:
21
+ merge:
22
+ method: merge
23
+ - name: Merge when all checks pass and the PR has been approved
24
+ conditions:
25
+ - and:
26
+ - check-success~=^security/snyk
27
+ - check-success=SonarCloud Code Analysis
28
+ - "#approved-reviews-by>=1"
29
+ - "#changes-requested-reviews-by=0"
30
+ actions:
31
+ merge:
32
+ method: merge
33
+ - name: Ask for reviews
34
+ conditions:
35
+ - -closed
36
+ - -draft
37
+ actions:
38
+ request_reviews:
39
+ users:
40
+ - JoshTheWanderer
41
+ - DanWebb
42
+ - gavmck
43
+ - ella-etch
44
+ - Carl-J-M
45
+ random_count: 2
@@ -0,0 +1,9 @@
1
+ ---
2
+ # Always validate the PR title AND all the commits
3
+ titleAndCommits: true
4
+ # Allows use of Merge commits (eg on github: "Merge branch 'main' into feature/ride-unicorns")
5
+ # this is only relevant when using commitsOnly: true (or titleAndCommits: true)
6
+ allowMergeCommits: true
7
+ # Allow use of Revert commits (eg on github: "Revert "feat: ride unicorns"")
8
+ # this is only relevant when using commitsOnly: true (or titleAndCommits: true)
9
+ allowRevertCommits: true
@@ -0,0 +1,33 @@
1
+ name: 🚀 Publish
2
+ on:
3
+ push:
4
+ branches:
5
+ - main
6
+
7
+ env:
8
+ HUSKY: 0
9
+
10
+ jobs:
11
+ publish:
12
+ name: Publish
13
+ runs-on: ubuntu-latest
14
+ if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v3
18
+ with:
19
+ fetch-depth: 0
20
+ persist-credentials: false
21
+ - name: Publish
22
+ uses: cycjimmy/semantic-release-action@v3
23
+ with:
24
+ semantic_version: 19.x
25
+ branch: main
26
+ extends: |
27
+ @semantic-release/git@10.0.1
28
+ @semantic-release/changelog@6.0.2
29
+ @commitlint/cli@17.3.0
30
+ @commitlint/config-conventional@17.3.0
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ npx --no -- commitlint --edit ${1}
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 18.12.1
@@ -0,0 +1,6 @@
1
+ {
2
+ "editor.formatOnSave": false,
3
+ "editor.codeActionsOnSave": {
4
+ "source.fixAll.eslint": true,
5
+ }
6
+ }
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ ISC License
2
+
3
+ Copyright 2022 Etch Software Limited
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @etchteam/eslint
2
+
3
+ The eslint config that we use at [Etch](https://etch.co)
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install eslint @etchteam/eslint
9
+ ```
10
+
11
+ ## Use
12
+
13
+ ```bash
14
+ echo "module.exports = { extends: ['@etchteam/eslint'] }" > .eslintrc.js
15
+ ```
@@ -0,0 +1 @@
1
+ module.exports = { extends: ['@commitlint/config-conventional'] };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ '*.js': 'eslint --fix',
3
+ };
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@etchteam/eslint-config",
3
+ "version": "0.0.1",
4
+ "description": "Etch's standard eslint config",
5
+ "main": "src/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "release": "semantic-release"
9
+ },
10
+ "engines": {
11
+ "node": "^14 || ^16 || ^18"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+ssh://git@github.com/etchteam/eslint.git"
16
+ },
17
+ "keywords": [
18
+ "eslint"
19
+ ],
20
+ "author": "Etch <hey@etch.co>",
21
+ "license": "ISC",
22
+ "bugs": {
23
+ "url": "https://github.com/etchteam/eslint/issues"
24
+ },
25
+ "homepage": "https://github.com/etchteam/eslint#readme",
26
+ "devDependencies": {
27
+ "@commitlint/cli": "^17.3.0",
28
+ "@commitlint/config-conventional": "^17.3.0",
29
+ "husky": "^8.0.2",
30
+ "lint-staged": "^13.1.0"
31
+ },
32
+ "dependencies": {
33
+ "eslint": "^8.29.0",
34
+ "eslint-config-next": "^13.0.7",
35
+ "eslint-config-prettier": "^8.5.0",
36
+ "eslint-plugin-import": "^2.26.0",
37
+ "eslint-plugin-prettier": "^4.2.1",
38
+ "eslint-plugin-security": "^1.5.0",
39
+ "eslint-plugin-storybook": "^0.6.8",
40
+ "eslint-plugin-unused-imports": "^2.0.0",
41
+ "prettier": "^2.8.1"
42
+ }
43
+ }
@@ -0,0 +1,29 @@
1
+ module.exports = {
2
+ branches: ['main'],
3
+ plugins: [
4
+ [
5
+ '@semantic-release/commit-analyzer',
6
+ {
7
+ preset: 'conventionalcommits',
8
+ presetConfig: {},
9
+ },
10
+ ],
11
+ [
12
+ '@semantic-release/release-notes-generator',
13
+ {
14
+ preset: 'conventionalcommits',
15
+ },
16
+ ],
17
+ '@semantic-release/changelog',
18
+ [
19
+ '@semantic-release/npm',
20
+ {
21
+ npmPublish: true,
22
+ },
23
+ ],
24
+ '@semantic-release/github',
25
+
26
+ // NOTE: this plugin must be last to ensure all updated files are committed
27
+ '@semantic-release/git',
28
+ ],
29
+ };
@@ -0,0 +1,34 @@
1
+ module.exports = {
2
+ extends: [
3
+ 'next/core-web-vitals',
4
+ 'plugin:@typescript-eslint/recommended',
5
+ 'plugin:storybook/recommended',
6
+ 'plugin:security/recommended',
7
+ 'plugin:import/recommended',
8
+ 'plugin:import/typescript',
9
+ 'plugin:prettier/recommended',
10
+ ],
11
+ plugins: ['unused-imports'],
12
+ parser: '@typescript-eslint/parser',
13
+ rules: {
14
+ 'no-unused-vars': 'off',
15
+ '@typescript-eslint/no-unused-vars': 'error',
16
+ 'unused-imports/no-unused-imports': 'error',
17
+ 'unused-imports/no-unused-vars': 'off',
18
+ 'import/order': ['error', {
19
+ 'newlines-between': 'always',
20
+ alphabetize: {
21
+ order: 'asc'
22
+ },
23
+ }],
24
+ },
25
+ settings: {
26
+ 'import/resolver': {
27
+ typescript: true,
28
+ node: true
29
+ },
30
+ 'prettier/prettier': {
31
+ singleQuote: true,
32
+ },
33
+ }
34
+ };
package/src/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import config from './.eslintrc.js';
2
+
3
+ export default config;