Skip to content

Commit 938e12b

Browse files
authored
feat: add kintone-customize presets (#737)
1 parent 30ecf1b commit 938e12b

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

README.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,24 @@ rules: {
150150

151151
## For kintone customize developers
152152

153-
`@cybozu/eslint-config/preset/kintone-customize-es5` is a preset for kintone customize(plug-in) developers, which is based on `preset/es5` and add some `globals` for kintone.
153+
We also provide presets for kintone customize/plug-in developers, which include some `globals` for kintone.
154+
155+
### Usage
154156

155157
```js
158+
// .eslintrc.js
156159
module.exports = {
157-
extends: "@cybozu/eslint-config/presets/kintone-customize-es5"
160+
extends: "@cybozu/eslint-config/presets/kintone-customize"
158161
};
159162
```
160163

161-
We also provide `@cybozu/eslint-config/presets/kintone-customize-es5-prettier` to use it with `prettier`.
164+
### Presets
165+
166+
- `@cybozu/eslint-config/preset/kintone-customize`
167+
- Preset for kintone customize/plugin-in development
168+
- `@cybozu/eslint-config/preset/kintone-customize-prettier`
169+
- Preset for kintone customize/plugin-in development including `prettier` config
170+
- `@cybozu/eslint-config/preset/kintone-customize-es5`
171+
- Preset for kintone customize/plugin-in development in ES5
172+
- `@cybozu/eslint-config/preset/kintone-customize-es5-prettier`
173+
- Preset for kintone customize/plugin-in development in ES5 including `prettier` config

presets/kintone-customize-prettier.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
extends: [
3+
"../lib/base.js",
4+
"../lib/kintone.js",
5+
"../globals/kintone.js",
6+
"../lib/prettier.js",
7+
],
8+
};

presets/kintone-customize.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ["../lib/base.js", "../lib/kintone.js", "../globals/kintone.js"],
3+
};

test/presets-test.js

+19
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ describe("presets", () => {
5555
);
5656
});
5757
});
58+
describe("kintone-customize", () => {
59+
it("should be able to use kintone-customize as well as lib/base", async () => {
60+
assert.deepStrictEqual(
61+
await runLintWithFixtures("base"),
62+
await runLintWithFixtures("base", "presets/kintone-customize.js"),
63+
);
64+
});
65+
});
66+
describe("kintone-customize-prettier", () => {
67+
it("should be able to use kintone-customize-prettier as well as lib/prettier", async () => {
68+
assert.deepStrictEqual(
69+
await runLintWithFixtures("prettier"),
70+
await runLintWithFixtures(
71+
"prettier",
72+
"presets/kintone-customize-prettier.js",
73+
),
74+
);
75+
});
76+
});
5877
describe("prettier", () => {
5978
it("should be able to use prettier as well as lib/prettier", async () => {
6079
assert.deepStrictEqual(

0 commit comments

Comments
 (0)