@prestashopcorp/openapilint-config

0.0.2 • Public • Published

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"
}
...

⚠️ Make sure to have your spectral.yaml and openapi.yaml files at the same level. If you really want to separate them, make sure to at least always leave spectral.yaml at the root of your project and change the file destination in your package.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

Package Sidebar

Install

npm i @prestashopcorp/openapilint-config

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

3.44 kB

Total Files

3

Last publish

Collaborators

  • morraycage
  • devops-prestashop
  • claude-arnaud
  • tdaveaupresta
  • rxmat_presta
  • natsuflame