@prestashopcorp/openapilint-config
v0.0.2
Published
Basic Openapi rules for PrestaShop projects
Downloads
5
Readme
Openapi Linter
This package is a tool for linting OpenApi specifications using a set of base rules fitting PrestaShop needs. It uses @stoplight/spectral and is entirely overridable.
This readme only offers some basic knowledge on how to use the package. Head over to the official spectral documentation for more details.
Installation
# npm
npm i -D @prestashopcorp/openapilint-config
# yarn
yarn add -D @prestashopcorp/openapilint-config
Usage
Execute this command at the root of your project:
echo 'extends: ["@prestashopcorp/openapilint-config"]' > .spectral.yaml
Add a new script in your package.json
:
...
"scripts": {
"lint:openapi": "spectral lint ./openapi.yaml"
}
...
:warning: Make sure to have your
spectral.yaml
andopenapi.yaml
files at the same level. If you really want to separate them, make sure to at least always leavespectral.yaml
at the root of your project and change the file destination in yourpackage.json
scripts section.
You're all set !
Deactivating a rule
Here is an exemple of how to deactivate the rule "camel-case":
extends: ['@prestashopcorp/openapilint-config']
overrides:
rules:
camel-case: "off"
For more detailed informations and how-tos, please see here.
Adding a rule
Please see this section of the spectral documentation.
List of rules
- camel-case