Skip to content

Commit

Permalink
feat: add kintone-customize presets (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
tasshi-me authored Jan 17, 2025
1 parent 30ecf1b commit 938e12b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,24 @@ rules: {

## For kintone customize developers

`@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.
We also provide presets for kintone customize/plug-in developers, which include some `globals` for kintone.

### Usage

```js
// .eslintrc.js
module.exports = {
extends: "@cybozu/eslint-config/presets/kintone-customize-es5"
extends: "@cybozu/eslint-config/presets/kintone-customize"
};
```

We also provide `@cybozu/eslint-config/presets/kintone-customize-es5-prettier` to use it with `prettier`.
### Presets

- `@cybozu/eslint-config/preset/kintone-customize`
- Preset for kintone customize/plugin-in development
- `@cybozu/eslint-config/preset/kintone-customize-prettier`
- Preset for kintone customize/plugin-in development including `prettier` config
- `@cybozu/eslint-config/preset/kintone-customize-es5`
- Preset for kintone customize/plugin-in development in ES5
- `@cybozu/eslint-config/preset/kintone-customize-es5-prettier`
- Preset for kintone customize/plugin-in development in ES5 including `prettier` config
8 changes: 8 additions & 0 deletions presets/kintone-customize-prettier.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: [
"../lib/base.js",
"../lib/kintone.js",
"../globals/kintone.js",
"../lib/prettier.js",
],
};
3 changes: 3 additions & 0 deletions presets/kintone-customize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ["../lib/base.js", "../lib/kintone.js", "../globals/kintone.js"],
};
19 changes: 19 additions & 0 deletions test/presets-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,25 @@ describe("presets", () => {
);
});
});
describe("kintone-customize", () => {
it("should be able to use kintone-customize as well as lib/base", async () => {
assert.deepStrictEqual(
await runLintWithFixtures("base"),
await runLintWithFixtures("base", "presets/kintone-customize.js"),
);
});
});
describe("kintone-customize-prettier", () => {
it("should be able to use kintone-customize-prettier as well as lib/prettier", async () => {
assert.deepStrictEqual(
await runLintWithFixtures("prettier"),
await runLintWithFixtures(
"prettier",
"presets/kintone-customize-prettier.js",
),
);
});
});
describe("prettier", () => {
it("should be able to use prettier as well as lib/prettier", async () => {
assert.deepStrictEqual(
Expand Down

0 comments on commit 938e12b

Please sign in to comment.