@open-turo/eslint-config 1.0.3 → 1.0.5
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/.github/renovate.json +6 -0
- package/.github/workflows/ci.yaml +10 -1
- package/.github/workflows/release.yaml +6 -4
- package/.github/workflows/update-dependencies.yaml +23 -0
- package/.pre-commit-config.yaml +3 -3
- package/.releaserc.json +1 -24
- package/README.md +9 -0
- package/index.js +18 -21
- package/pack/open-turo-eslint-config-1.0.5.tgz +0 -0
- package/package.json +29 -22
- package/test.js +21 -0
- package/.github/dependabot.yaml +0 -12
- package/pack/open-turo-eslint-config-1.0.3.tgz +0 -0
@@ -8,7 +8,8 @@ jobs:
|
|
8
8
|
name: Lint
|
9
9
|
runs-on: ubuntu-latest
|
10
10
|
steps:
|
11
|
-
-
|
11
|
+
- name: Checkout
|
12
|
+
uses: actions/checkout@v3
|
12
13
|
with:
|
13
14
|
fetch-depth: 0
|
14
15
|
- name: Download actionlint
|
@@ -17,3 +18,11 @@ jobs:
|
|
17
18
|
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) latest "$HOME/bin"
|
18
19
|
echo "${HOME}/bin" >> "$GITHUB_PATH"
|
19
20
|
- uses: open-turo/action-pre-commit@v1
|
21
|
+
|
22
|
+
test:
|
23
|
+
name: Test
|
24
|
+
runs-on: ubuntu-latest
|
25
|
+
steps:
|
26
|
+
- uses: open-turo/actions-node/test@v3
|
27
|
+
with:
|
28
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
@@ -9,15 +9,17 @@ jobs:
|
|
9
9
|
release:
|
10
10
|
runs-on: ubuntu-latest
|
11
11
|
steps:
|
12
|
-
-
|
12
|
+
- name: Checkout
|
13
|
+
uses: actions/checkout@v3
|
13
14
|
with:
|
14
15
|
fetch-depth: 0
|
15
|
-
|
16
|
+
persist-credentials: false
|
17
|
+
- name: Semantic release
|
16
18
|
id: release
|
17
|
-
uses: cycjimmy/semantic-release-action@
|
19
|
+
uses: cycjimmy/semantic-release-action@v3
|
18
20
|
with:
|
19
21
|
extra_plugins: |
|
20
|
-
semantic-release-
|
22
|
+
@open-turo/semantic-release-config
|
21
23
|
env:
|
22
24
|
GITHUB_TOKEN: ${{ secrets.OPEN_TURO_GITHUB_TOKEN }}
|
23
25
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: Update dependencies
|
2
|
+
concurrency: update-dependencies
|
3
|
+
|
4
|
+
on:
|
5
|
+
schedule:
|
6
|
+
# Every day at midnight
|
7
|
+
- cron: "0 0 * * *"
|
8
|
+
workflow_dispatch:
|
9
|
+
issue_comment:
|
10
|
+
types:
|
11
|
+
- edited
|
12
|
+
pull_request:
|
13
|
+
types:
|
14
|
+
- edited
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
update-dependencies:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
name: Update dependencies
|
20
|
+
steps:
|
21
|
+
- uses: open-turo/action-renovate@v1
|
22
|
+
with:
|
23
|
+
github-token: ${{ secrets.OPEN_TURO_GITHUB_TOKEN }}
|
package/.pre-commit-config.yaml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
repos:
|
2
2
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
3
|
-
rev: v4.
|
3
|
+
rev: v4.4.0
|
4
4
|
hooks:
|
5
5
|
- id: check-json
|
6
6
|
- id: check-yaml
|
@@ -12,12 +12,12 @@ repos:
|
|
12
12
|
- id: prettier
|
13
13
|
stages: [commit]
|
14
14
|
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
|
15
|
-
rev:
|
15
|
+
rev: v9.4.0
|
16
16
|
hooks:
|
17
17
|
- id: commitlint
|
18
18
|
stages: [commit-msg]
|
19
19
|
additional_dependencies: ["@open-turo/commitlint-config-conventional"]
|
20
20
|
- repo: https://github.com/rhysd/actionlint
|
21
|
-
rev: v1.6.
|
21
|
+
rev: v1.6.22
|
22
22
|
hooks:
|
23
23
|
- id: actionlint
|
package/.releaserc.json
CHANGED
@@ -1,26 +1,3 @@
|
|
1
1
|
{
|
2
|
-
"
|
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
|
-
]
|
2
|
+
"extends": "@open-turo/semantic-release-config/lib/npm"
|
26
3
|
}
|
package/README.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
Turo eslint configuration
|
4
4
|
|
5
|
+
[](https://github.com/open-turo/eslint-config/releases/)
|
6
|
+
[](https://github.com/open-turo/eslint-config/actions/)
|
7
|
+
[](./LICENSE)
|
8
|
+
[](https://github.com/dwyl/esta/issues)
|
9
|
+

|
10
|
+
[](https://github.com/semantic-release/semantic-release)
|
11
|
+
[](https://conventionalcommits.org)
|
12
|
+
[](https://turo.com/jobs)
|
13
|
+
|
5
14
|
## Usage
|
6
15
|
|
7
16
|
Install the package and all of its peer dependencies:
|
package/index.js
CHANGED
@@ -10,36 +10,33 @@ module.exports = {
|
|
10
10
|
"plugin:unicorn/recommended",
|
11
11
|
"plugin:node/recommended",
|
12
12
|
],
|
13
|
+
parserOptions: {
|
14
|
+
ecmaVersion: 2020,
|
15
|
+
sourceType: "module",
|
16
|
+
ecmaFeatures: {
|
17
|
+
modules: true,
|
18
|
+
},
|
19
|
+
},
|
13
20
|
plugins: [
|
14
|
-
"import",
|
15
|
-
"json",
|
16
21
|
"import",
|
17
22
|
"jest",
|
23
|
+
"json",
|
24
|
+
"node",
|
18
25
|
"prettier",
|
19
26
|
"simple-import-sort",
|
20
27
|
"sonarjs",
|
21
28
|
"sort-destructure-keys",
|
22
29
|
"unicorn",
|
23
|
-
"node",
|
24
30
|
],
|
25
31
|
rules: {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
"import/named": "off",
|
36
|
-
"import/namespace": "off",
|
37
|
-
"import/no-default-export": "error",
|
38
|
-
"import/prefer-default-export": "off",
|
39
|
-
"prettier/prettier": "error",
|
40
|
-
"simple-import-sort/imports": "error",
|
41
|
-
"simple-import-sort/exports": "error",
|
42
|
-
"sort-destructure-keys/sort-destructure-keys": "error",
|
43
|
-
},
|
32
|
+
"import/default": "off",
|
33
|
+
"import/named": "off",
|
34
|
+
"import/namespace": "off",
|
35
|
+
"import/no-default-export": "error",
|
36
|
+
"import/prefer-default-export": "off",
|
37
|
+
"prettier/prettier": "error",
|
38
|
+
"simple-import-sort/imports": "error",
|
39
|
+
"simple-import-sort/exports": "error",
|
40
|
+
"sort-destructure-keys/sort-destructure-keys": "error",
|
44
41
|
},
|
45
42
|
};
|
Binary file
|
package/package.json
CHANGED
@@ -2,25 +2,27 @@
|
|
2
2
|
"author": "Turo engineering",
|
3
3
|
"description": "Eslint configuration for Turo",
|
4
4
|
"devDependencies": {
|
5
|
-
"@commitlint/cli": "
|
6
|
-
"@open-turo/commitlint-config-conventional": "
|
7
|
-
"@semantic-release
|
8
|
-
"eslint": "
|
9
|
-
"eslint-config-airbnb-base": "
|
10
|
-
"eslint-config-prettier": "
|
11
|
-
"eslint-plugin-import": "
|
12
|
-
"eslint-plugin-jest": "
|
13
|
-
"eslint-plugin-json": "
|
14
|
-
"eslint-plugin-
|
15
|
-
"eslint-plugin-
|
16
|
-
"eslint-plugin-
|
17
|
-
"eslint-plugin-
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
5
|
+
"@commitlint/cli": "17.4.2",
|
6
|
+
"@open-turo/commitlint-config-conventional": "1.0.4",
|
7
|
+
"@open-turo/semantic-release-config": "1.0.1",
|
8
|
+
"eslint": "8.32.0",
|
9
|
+
"eslint-config-airbnb-base": "15.0.0",
|
10
|
+
"eslint-config-prettier": "8.6.0",
|
11
|
+
"eslint-plugin-import": "2.27.5",
|
12
|
+
"eslint-plugin-jest": "27.2.1",
|
13
|
+
"eslint-plugin-json": "3.1.0",
|
14
|
+
"eslint-plugin-node": "^11.1.0",
|
15
|
+
"eslint-plugin-prettier": "4.2.1",
|
16
|
+
"eslint-plugin-simple-import-sort": "8.0.0",
|
17
|
+
"eslint-plugin-sonarjs": "0.18.0",
|
18
|
+
"eslint-plugin-sort-destructure-keys": "1.4.0",
|
19
|
+
"eslint-plugin-unicorn": "^45.0.2",
|
20
|
+
"jest": "^29.3.1",
|
21
|
+
"prettier": "2.8.3",
|
22
|
+
"semantic-release": "19.0.5"
|
21
23
|
},
|
22
24
|
"engines": {
|
23
|
-
"node": ">=
|
25
|
+
"node": ">= 16"
|
24
26
|
},
|
25
27
|
"homepage": "https://github.com/open-turo/eslint-config#readme",
|
26
28
|
"license": "MIT",
|
@@ -31,16 +33,21 @@
|
|
31
33
|
"eslint-config-airbnb-base": "^15.0.0",
|
32
34
|
"eslint-config-prettier": "^8.5.0",
|
33
35
|
"eslint-plugin-import": "^2.25.4",
|
34
|
-
"eslint-plugin-jest": "^
|
36
|
+
"eslint-plugin-jest": "^27.0.1",
|
35
37
|
"eslint-plugin-json": "^3.1.0",
|
38
|
+
"eslint-plugin-node": "^11.1.0",
|
36
39
|
"eslint-plugin-prettier": "^4.0.0",
|
37
|
-
"eslint-plugin-simple-import-sort": "^
|
38
|
-
"eslint-plugin-sonarjs": "^0.
|
39
|
-
"eslint-plugin-sort-destructure-keys": "^1.4.0"
|
40
|
+
"eslint-plugin-simple-import-sort": "^8.0.0",
|
41
|
+
"eslint-plugin-sonarjs": "^0.17.0 || ^0.18.0",
|
42
|
+
"eslint-plugin-sort-destructure-keys": "^1.4.0",
|
43
|
+
"eslint-plugin-unicorn": "^45.0.2"
|
40
44
|
},
|
41
45
|
"publishConfig": {
|
42
46
|
"access": "public"
|
43
47
|
},
|
44
48
|
"repository": "https://github.com/open-turo/eslint-config",
|
45
|
-
"
|
49
|
+
"scripts": {
|
50
|
+
"test": "jest test.js"
|
51
|
+
},
|
52
|
+
"version": "1.0.5"
|
46
53
|
}
|
package/test.js
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
const fs = require("fs");
|
2
|
+
const { ESLint } = require("eslint");
|
3
|
+
|
4
|
+
describe("validate config", () => {
|
5
|
+
it(`load config file in ESLint to validate all rules are correct`, async () => {
|
6
|
+
const stringConfig = fs.readFileSync("./test.js", "utf8");
|
7
|
+
|
8
|
+
const cli = new ESLint({
|
9
|
+
overrideConfigFile: "./index.js",
|
10
|
+
});
|
11
|
+
|
12
|
+
const lintResult = await cli.lintText(stringConfig);
|
13
|
+
|
14
|
+
/**
|
15
|
+
* We just need to validate a value is returned.
|
16
|
+
* If there is an issue with the config, `cli.lintText` will error,
|
17
|
+
* and we will never hit this line so the test will fail.
|
18
|
+
*/
|
19
|
+
expect(lintResult).toBeTruthy();
|
20
|
+
});
|
21
|
+
});
|
package/.github/dependabot.yaml
DELETED
Binary file
|