Skip to content

Commit 5297489

Browse files
committed
Drop support for ESLint < 9.15
1 parent 34895b5 commit 5297489

File tree

5 files changed

+46
-39
lines changed

5 files changed

+46
-39
lines changed

.github/workflows/nodejs.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Node.js CI
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: ['**']
6+
tags-ignore: ['**']
7+
pull_request:
8+
branches: ['**']
49

510
jobs:
611

@@ -9,10 +14,10 @@ jobs:
914
runs-on: ubuntu-latest
1015

1116
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v4
17+
- uses: actions/checkout@v5
18+
- uses: actions/setup-node@v5
1419
with:
15-
node-version: '22'
20+
node-version: '24'
1621
- run: |
1722
npm install
1823
gulp lint
@@ -25,11 +30,11 @@ jobs:
2530

2631
strategy:
2732
matrix:
28-
node-version: ['18', '20', '22']
33+
node-version: ['18', '20', '22', '24']
2934

3035
steps:
31-
- uses: actions/checkout@v4
32-
- uses: actions/setup-node@v4
36+
- uses: actions/checkout@v5
37+
- uses: actions/setup-node@v5
3338
with:
3439
node-version: ${{ matrix.node-version }}
3540
- run: |

README.md

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,29 @@ Install ESLint and `@origin-1/eslint-plugin`:
1010
npm i --save-dev eslint @origin-1/eslint-plugin
1111
```
1212

13-
### Note
14-
15-
If you installed ESLint globally (using the `-g` flag) then you must also install plugins globally:
16-
17-
```console
18-
npm i -g @origin-1/eslint-plugin
19-
```
20-
2113
## Usage
2214

23-
Add `"@origin-1"` to the `"plugins"` section of your `.eslintrc` configuration file.
24-
Then configure the rules defined by this plugin under the `"rules"` section.
15+
Add `"@origin-1"` to the `plugins` section of a configuration object in your ESLint configuration
16+
file.
17+
Then configure the rules defined by this plugin under the `rules` section.
18+
19+
```js
20+
import origin1 from "@origin-1/eslint-plugin";
2521

26-
```json
22+
export default
2723
{
28-
"plugins": [
29-
"@origin-1"
30-
],
31-
"rules": {
32-
"@origin-1/bracket-layout": "error",
33-
"@origin-1/indent": "error",
34-
"@origin-1/nice-space-before-function-paren": "error",
35-
"@origin-1/no-extra-new": "error",
36-
"@origin-1/no-spaces-in-call-expression": "error",
37-
"@origin-1/no-spaces-in-tagged-template": "error",
38-
"@origin-1/property-colon-spacing": "error"
24+
plugins: { "@origin-1": origin1 },
25+
rules:
26+
{
27+
"@origin-1/bracket-layout": "error",
28+
"@origin-1/indent": "error",
29+
"@origin-1/nice-space-before-function-paren": "error",
30+
"@origin-1/no-extra-new": "error",
31+
"@origin-1/no-spaces-in-call-expression": "error",
32+
"@origin-1/no-spaces-in-tagged-template": "error",
33+
"@origin-1/property-colon-spacing": "error"
3934
}
40-
}
35+
};
4136
```
4237

4338
## Rules

gulpfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ task
2222
[
2323
{ finished },
2424
{ createFlatConfig },
25-
{ default: eslintPluginAll },
25+
{ default: { configs: { all: eslintPluginAll } } },
2626
{ default: globals },
2727
{ default: gulpESLintNew },
2828
] =
@@ -31,7 +31,7 @@ task
3131
[
3232
import('node:stream/promises'),
3333
import('@origin-1/eslint-config'),
34-
import('eslint-plugin-eslint-plugin/configs/all'),
34+
import('eslint-plugin-eslint-plugin'),
3535
import('globals'),
3636
import('gulp-eslint-new'),
3737
],

lib/rules/indent.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,21 @@ function isTemplateToken(token)
2424

2525
const meta =
2626
{
27-
type: 'layout',
27+
type: 'layout',
2828
docs:
2929
{
3030
description: 'Enforce consistent indentation',
3131
url: makeRuleDocsURL('indent'),
3232
},
33-
fixable: 'whitespace',
34-
schema: [{ type: 'integer' }],
33+
fixable: 'whitespace',
34+
schema:
35+
[
36+
{
37+
type: 'integer',
38+
description: 'Expected indentation of the first line of code, in units of 4 spaces',
39+
},
40+
],
41+
defaultOptions: [0],
3542
messages:
3643
{
3744
indent:
@@ -267,7 +274,7 @@ function create(context)
267274
}
268275
}
269276

270-
const initialIndentUnits = context.options[0] ?? 0;
277+
const [initialIndentUnits] = context.options;
271278
const sourceCode = context.getSourceCode();
272279
const sourceLines = sourceCode.getLines();
273280
const lineCount = sourceLines.length;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@origin-1/eslint-config": "latest",
34-
"@typescript-eslint/parser": "rc-v8",
34+
"@typescript-eslint/parser": "latest",
3535
"c8js": "latest",
3636
"eslint-formatter-compact": "latest",
3737
"eslint-plugin-eslint-plugin": "latest",
@@ -40,9 +40,9 @@
4040
"mocha": "latest"
4141
},
4242
"peerDependencies": {
43-
"eslint": "^8.44 || 9"
43+
"eslint": "^9.15"
4444
},
4545
"engines": {
46-
"node": ">=18"
46+
"node": "^18.18 || ^20.9 || >=21.1"
4747
}
4848
}

0 commit comments

Comments
 (0)