Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add kintone-customize presets #737

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Expand Up @@ -126,12 +126,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
@@ -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
@@ -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
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