Skip to content

Commit 7086954

Browse files
YusukeHiraoclaude
andcommitted
chore(eslint): resolve merge conflicts with dev branch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 parents db9e5ca + a8c2f04 commit 7086954

17 files changed

Lines changed: 767 additions & 19 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
| パッケージ名 | 内容 |
2828
| -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29+
| [`@d-zero/eslint-plugin`](./packages/%40d-zero/eslint-plugin/) | [`@d-zero/eslint-config`](./packages/%40d-zero/eslint-config/)に設定されているディーゼロ独自のESLintルール |
2930
| [`@d-zero/stylelint-rules`](./packages/%40d-zero/stylelint-rules/) | [`@d-zero/stylelint-config`](./packages/%40d-zero/stylelint-config/)に設定されているディーゼロ独自のStylelintルール |
3031
| [`@d-zero/csstree-scss-syntax`](./packages/%40d-zero/csstree-scss-syntax/) | [`@d-zero/stylelint-rules`](./packages/%40d-zero/stylelint-rules/)内で使用されている[CSSTree](https://github.com/csstree/csstree)用の[SCSS](https://sass-lang.com/documentation/syntax/#scss)パーサープラグイン |
3132

cspell.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
"unspaced",
77

88
//
9-
"splide"
9+
"splide",
10+
11+
// ESLint plugin
12+
"dzero",
13+
"TSES"
1014
],
1115
"overrides": [
1216
{

packages/@d-zero/eslint-config/base.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import dzeroPlugin from '@d-zero/eslint-plugin';
12
import { fixupPluginRules } from '@eslint/compat';
23
import js from '@eslint/js';
34
import comments from '@eslint-community/eslint-plugin-eslint-comments';
@@ -258,4 +259,12 @@ export const base = [
258259
},
259260
},
260261
},
262+
{
263+
plugins: {
264+
'@d-zero': dzeroPlugin,
265+
},
266+
rules: {
267+
'@d-zero/no-click-event': 'warn',
268+
},
269+
},
261270
];

packages/@d-zero/eslint-config/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
".": "./index.js"
2020
},
2121
"dependencies": {
22+
"@d-zero/eslint-plugin": "5.0.0",
2223
"@eslint-community/eslint-plugin-eslint-comments": "4.6.0",
2324
"@eslint/compat": "2.0.2",
2425
"@eslint/js": "10.0.1",
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [5.0.0] - TBD
6+
7+
### Added
8+
9+
- Initial release of @d-zero/eslint-plugin
10+
- Added `no-click-event` rule to discourage click event handlers in favor of Invoker Commands API
11+
- Detects `addEventListener('click')`
12+
- Detects `onclick` IDL property assignment
13+
- Detects jQuery `.on('click')` and `.click()`
14+
- Detects React `onClick` JSX attribute
15+
- Detects Vue `@click` and `v-on:click`
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 D-ZERO Co., Ltd.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# `@d-zero/eslint-plugin`
2+
3+
Custom ESLint rules for D-ZERO.
4+
5+
## Installation
6+
7+
```sh
8+
npm install @d-zero/eslint-plugin --save-dev
9+
```
10+
11+
## Configuration
12+
13+
Add the following to your `eslint.config.js`:
14+
15+
```js
16+
import dzeroPlugin from '@d-zero/eslint-plugin';
17+
18+
export default [
19+
{
20+
plugins: {
21+
'@d-zero': dzeroPlugin,
22+
},
23+
rules: {
24+
'@d-zero/no-click-event': 'warn',
25+
},
26+
},
27+
];
28+
```
29+
30+
## Rules
31+
32+
### `@d-zero/no-click-event`
33+
34+
Disallows click event handlers in favor of the [Invoker Commands API](https://developer.mozilla.org/docs/Web/API/Invoker_Commands_API).
35+
36+
**Detected patterns:**
37+
38+
- `addEventListener('click', ...)`
39+
- `element.onclick = ...`
40+
- jQuery `.on('click', ...)` and `.click()`
41+
- React `onClick={...}`
42+
- Vue `@click` and `v-on:click`
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "@d-zero/eslint-plugin",
3+
"version": "5.0.0",
4+
"description": "Custom ESLint rules for D-ZERO",
5+
"repository": "https://github.com/d-zero-dev/linters.git",
6+
"author": "D-ZERO Co., Ltd.",
7+
"license": "MIT",
8+
"publishConfig": {
9+
"access": "public"
10+
},
11+
"engines": {
12+
"node": ">=22.0.0"
13+
},
14+
"type": "module",
15+
"exports": {
16+
".": "./dist/index.js"
17+
},
18+
"files": [
19+
"dist"
20+
],
21+
"scripts": {
22+
"build": "tsc"
23+
},
24+
"peerDependencies": {
25+
"eslint": ">=9.0.0"
26+
},
27+
"dependencies": {
28+
"@typescript-eslint/utils": "8.53.1"
29+
},
30+
"devDependencies": {
31+
"@typescript-eslint/parser": "8.53.1",
32+
"@typescript-eslint/rule-tester": "8.53.1",
33+
"eslint": "9.39.2",
34+
"vue-eslint-parser": "9.4.3"
35+
}
36+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const REPOSITORY_URL =
2+
'https://github.com/d-zero-dev/linters/tree/main/packages/%40d-zero/eslint-plugin/src/rules';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import noClickEvent from './rules/no-click-event/index.js';
2+
3+
const plugin = {
4+
meta: {
5+
name: '@d-zero/eslint-plugin',
6+
version: '5.0.0',
7+
},
8+
rules: {
9+
'no-click-event': noClickEvent,
10+
},
11+
};
12+
13+
export default plugin;

0 commit comments

Comments
 (0)