2.1.0 • Published 1 month ago

@checkdigit/spectral-config v2.1.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
1 month ago

Check Digit Spectral Config

Check Digit Spectral Config is the standard package to install and configure Spectral for use in Check Digit projects.

Installing

Spectral Config should be installed as a dev dependency: npm install @checkdigit/spectral-config --save-dev

Additional Setup

Once installed, add a file named .spectral.json to the root of your project. This file should extend Spectral Config:

{
  "extends": ["@checkdigit/spectral-config"]
}

Also add the following to your package.json to run Spectral:

{
  "scripts": {
    "lint:openapi": "spectral lint src/**/swagger.yml"
  }
}

To include Spectral in your project's CI/CD pipeline, add the following to your package.json:

{
  "scripts": {
    "ci:lint": "... && npm run lint:openapi"
  }
}

Plugins

Webstorm

Install Spectral, by Schwartz IT https://plugins.jetbrains.com/plugin/18520-spectral

Configure at WebStorm > Settings > Tools > Spectral.

Set Ruleset to the absolute path to project's .spectral.json (/Users/.../payment-card/.spectral.json). This plugin doesn't seem to respect path variables, so this will be global. Hopefully this will be fixed in a future plugin update.

Set Included files to the following glob pattern **/*swagger.yml.

VS Code

Install Spectral, by Spotlight https://marketplace.visualstudio.com/items?itemName=stoplight.spectral

Rules for Certain Warnings and Errors

operation-operationId Operation must have "operationId"

Add an operationId to the operation. Check Digit uses a noun-noun-verb naming convention. For example, the correct operationId for a PUT to path /resource/{id}/item/{itemId}/key is resource-item-key-put

2.1.0-PR.17-3201

1 month ago

2.1.0

1 month ago

2.1.0-PR.17-6936

1 month ago

2.0.0-PR.12-985a

10 months ago

2.0.1-PR.14-d71d

9 months ago

2.0.0-PR.14-c65b

9 months ago

2.0.1

9 months ago

2.0.0

10 months ago

2.0.1-PR.14-63f5

9 months ago

2.0.1-PR.14-8e62

9 months ago

2.0.1-PR.14-18da

9 months ago

2.0.0-PR.12-b7ee

10 months ago

2.0.0-PR.12-93f0

10 months ago

1.0.2

1 year ago

1.0.1-PR.5-28d1

1 year ago

1.0.1

1 year ago

1.0.0-PR.3-9af3

1 year ago

0.0.1-PR.2-66b3

1 year ago

0.0.1-PR.2-75e6

1 year ago

0.0.1-PR.2-7841

1 year ago

0.0.1-PR.2-39a8

1 year ago

0.0.1-PR.2-5fd4

1 year ago

0.0.1-PR.2-379c

1 year ago

0.0.1-PR.2-a40e

1 year ago

0.0.1-PR.2-046f

1 year ago

0.0.1-PR.2-9dbc

1 year ago

0.0.1-PR.2-4d6f

1 year ago

0.0.1-PR.2-c7b1

1 year ago

0.0.1-PR.2-7bdd

1 year ago