@open-turo/eslint-config 1.0.4 → 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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": [
3
+ "github>open-turo/renovate-config#v1",
4
+ "github>open-turo/renovate-config:npm-lib#v1"
5
+ ]
6
+ }
@@ -8,7 +8,8 @@ jobs:
8
8
  name: Lint
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
- - uses: actions/checkout@v3
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
- - uses: actions/checkout@v2
12
+ - name: Checkout
13
+ uses: actions/checkout@v3
13
14
  with:
14
15
  fetch-depth: 0
15
- - name: Semantic Release
16
+ persist-credentials: false
17
+ - name: Semantic release
16
18
  id: release
17
- uses: cycjimmy/semantic-release-action@v2
19
+ uses: cycjimmy/semantic-release-action@v3
18
20
  with:
19
21
  extra_plugins: |
20
- semantic-release-github-pullrequest
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 }}
@@ -1,6 +1,6 @@
1
1
  repos:
2
2
  - repo: https://github.com/pre-commit/pre-commit-hooks
3
- rev: v4.1.0
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: v8.0.0
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.8
21
+ rev: v1.6.22
22
22
  hooks:
23
23
  - id: actionlint
package/.releaserc.json CHANGED
@@ -1,26 +1,3 @@
1
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
- ]
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
+ [![Release](https://img.shields.io/github/v/release/open-turo/eslint-config)](https://github.com/open-turo/eslint-config/releases/)
6
+ [![Tests pass/fail](https://img.shields.io/github/workflow/status/open-turo/eslint-config/CI)](https://github.com/open-turo/eslint-config/actions/)
7
+ [![License](https://img.shields.io/github/license/open-turo/eslint-config)](./LICENSE)
8
+ [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://github.com/dwyl/esta/issues)
9
+ ![CI](https://github.com/open-turo/eslint-config/actions/workflows/release.yaml/badge.svg)
10
+ [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
11
+ [![Conventional commits](https://img.shields.io/badge/conventional%20commits-1.0.2-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
12
+ [![Join us!](https://img.shields.io/badge/Turo-Join%20us%21-593CFB.svg)](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
- parserOptions: {
27
- ecmaVersion: 2020,
28
- sourceType: "module",
29
- ecmaFeatures: {
30
- modules: true,
31
- },
32
- },
33
- rules: {
34
- "import/default": "off",
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
  };
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": "^17.0.3",
6
- "@open-turo/commitlint-config-conventional": "^1.0.2",
7
- "@semantic-release/git": "^10.0.1",
8
- "eslint": "^8.10.0",
9
- "eslint-config-airbnb-base": "^15.0.0",
10
- "eslint-config-prettier": "^8.5.0",
11
- "eslint-plugin-import": "^2.25.4",
12
- "eslint-plugin-jest": "^27.0.1",
13
- "eslint-plugin-json": "^3.1.0",
14
- "eslint-plugin-prettier": "^4.0.0",
15
- "eslint-plugin-simple-import-sort": "^7.0.0",
16
- "eslint-plugin-sonarjs": "^0.15.0",
17
- "eslint-plugin-sort-destructure-keys": "^1.4.0",
18
- "prettier": "^2.5.1",
19
- "semantic-release": "^19.0.2",
20
- "semantic-release-github-pullrequest": "^1.3.0"
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": ">= 14"
25
+ "node": ">= 16"
24
26
  },
25
27
  "homepage": "https://github.com/open-turo/eslint-config#readme",
26
28
  "license": "MIT",
@@ -33,14 +35,19 @@
33
35
  "eslint-plugin-import": "^2.25.4",
34
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": "^7.0.0",
38
- "eslint-plugin-sonarjs": "^0.15.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
- "version": "1.0.4"
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
+ });
@@ -1,12 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: npm
4
- directory: /
5
- reviewers:
6
- - "open-turo/node"
7
- schedule:
8
- interval: weekly
9
- commit-message:
10
- prefix: build(deps)
11
- prefix-development: build(dev-deps)
12
- include: scope