Skip to content

Commit d764ce5

Browse files
committed
✨ add eslint-config-cli
1 parent b0150ba commit d764ce5

File tree

7 files changed

+112
-0
lines changed

7 files changed

+112
-0
lines changed

eslint-config-cli/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# @dudeofawesome/eslint-config-node
2+
3+
My node eslint config
4+
5+
## Usage
6+
7+
1. Install this config plugin as a dev dependency.
8+
9+
```sh
10+
npm i -D @dudeofawesome/eslint-config-node
11+
```
12+
13+
1. Add the plugin to your `eslintrc`.
14+
15+
```yaml
16+
extends:
17+
- '@dudeofawesome'
18+
- '@dudeofawesome/node'
19+
```
20+
21+
1. You might also want to specify an `ecmaVersion`.
22+
23+
```yaml
24+
parserOptions:
25+
ecmaVersion: 2022
26+
```

eslint-config-cli/base.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends:
2+
- '@dudeofawesome/node'
3+
4+
rules:
5+
no-console: 'off'

eslint-config-cli/package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "@dudeofawesome/eslint-config-cli",
3+
"description": "My CLI ESLint config",
4+
"version": "1.3.0",
5+
"repository": {
6+
"type": "git",
7+
"url": "[email protected]:dudeofawesome/code-style.git",
8+
"directory": "/eslint-config-cli"
9+
},
10+
"keywords": [
11+
"style",
12+
"lint",
13+
"config",
14+
"eslint"
15+
],
16+
"author": "Louis Orleans <[email protected]>",
17+
"license": "MIT",
18+
"main": "base.yaml",
19+
"scripts": {
20+
"test": "function run() { node --require ts-node/register --test $@ 'test/index.ts'; }; run"
21+
},
22+
"dependencies": {
23+
"@shopify/eslint-plugin": "^43.0.0"
24+
},
25+
"peerDependencies": {
26+
"@dudeofawesome/eslint-config": "^1.0.0"
27+
},
28+
"devDependencies": {
29+
"@types/eslint": "^8.44.2",
30+
"@types/node": "^20.6.3",
31+
"ts-node": "^10.9.1"
32+
}
33+
}

eslint-config-cli/test/.eslintrc.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root: true
2+
extends:
3+
- '@dudeofawesome'
4+
- '@dudeofawesome/node'
5+
- '@dudeofawesome/cli'
6+
parserOptions:
7+
ecmaVersion: 2022

eslint-config-cli/test/index.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { describe, it } from 'node:test';
2+
import { ESLint } from 'eslint';
3+
import {
4+
testRuleFail,
5+
testNoFail,
6+
defaultTestSet,
7+
} from '../../utils/testing/eslint';
8+
9+
const linter = new ESLint({ cwd: __dirname });
10+
11+
describe('eslint-config-node', () => {
12+
defaultTestSet(linter);
13+
14+
describe('passes', () => {
15+
it(`should pass radix`, async () =>
16+
testNoFail(linter, `parseInt('10');\n`));
17+
18+
it(`should pass no-console`, () =>
19+
testNoFail(linter, `console.log('foo');\n`));
20+
});
21+
22+
describe('fails', () => {});
23+
});

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"workspaces": [
2323
"code-style",
2424
"eslint-config",
25+
"eslint-config-cli",
2526
"eslint-config-jest",
2627
"eslint-config-node",
2728
"eslint-config-typescript",

0 commit comments

Comments
 (0)