Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
rome: kbravh/rome@1.1.3
Use rome
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Linting a yarn project with Rome.
1
2
3
4
5
6
7
8
9
10
11
version: '2.1'
orbs:
node: circleci/node@4.0.1
rome: kbravh/rome@dev:alpha
jobs:
lint:
executor: node/default
steps:
- rome/check:
pkg-manager: yarn
workflows: null
Runs rome check command. https://romefrontend.dev/#rome-check
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
app-dir | Path to the directory containing your package.json file. Not needed if package.json lives in the root.
| No | . | string |
options | Other options to pass to the Rome check command. https://romefrontend.dev/#global-flags
| No | '' | string |
paths | The files or directories to check, if you don't want to check the entire project.
| No | '' | string |
pkg-manager | The package manager to use to install the project dependencies.
| No | npm | enum |
skip-install | This will skip the step for installing dependencies.
| No | false | boolean |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
An orb to run Rome commands
display:
home_url: https://romefrontend.dev/
source_url: https://github.com/kbravh/rome-orb
orbs:
node: circleci/node@4.0.1
commands:
check:
description: |
Runs rome check command. https://romefrontend.dev/#rome-check
parameters:
app-dir:
default: .
description: |
Path to the directory containing your package.json file. Not needed if package.json lives in the root.
type: string
options:
default: ""
description: |
Other options to pass to the Rome check command. https://romefrontend.dev/#global-flags
type: string
paths:
default: ""
description: |
The files or directories to check, if you don't want to check the entire project.
type: string
pkg-manager:
default: npm
description: |
The package manager to use to install the project dependencies.
enum:
- npm
- yarn
type: enum
skip-install:
default: false
description: |
This will skip the step for installing dependencies.
type: boolean
steps:
- checkout
- unless:
condition: << parameters.skip-install >>
steps:
- node/install-packages:
app-dir: << parameters.app-dir >>
pkg-manager: << parameters.pkg-manager >>
- run:
command: set -o pipefail
name: Set pipefail
- run:
command: npx rome check << parameters.paths >> << parameters.options >> | cat
working_directory: << parameters.app-dir >>
examples:
rome_lint:
description: |
Linting a yarn project with Rome.
usage:
version: "2.1"
orbs:
node: circleci/node@4.0.1
rome: kbravh/rome@dev:alpha
jobs:
lint:
executor: node/default
steps:
- rome/check:
pkg-manager: yarn
workflows: null