@abelspithost/eslint-config-ts 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +47 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Abel Spithost
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @abelspithost/eslint-config-ts
|
|
2
|
+
|
|
3
|
+
A shared ESLint flat config for TypeScript projects.
|
|
4
|
+
|
|
5
|
+
Includes:
|
|
6
|
+
|
|
7
|
+
- ESLint recommended rules
|
|
8
|
+
- [typescript-eslint](https://typescript-eslint.io/) recommended rules with type-aware linting via `projectService`
|
|
9
|
+
- Stylistic rules (trailing commas, semicolons, 2-space indent, etc.)
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -D @abelspithost/eslint-config-ts-ts eslint jiti typescript
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Create an `eslint.config.ts` in your project root:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import type { Config } from 'eslint/config';
|
|
23
|
+
import { createConfig } from '@abelspithost/eslint-config-ts';
|
|
24
|
+
|
|
25
|
+
const eslintConfig: Config[] = createConfig();
|
|
26
|
+
export default eslintConfig;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Custom options
|
|
30
|
+
|
|
31
|
+
You can override the default `files` and `ignores` patterns:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { createConfig } from '@abelspithost/eslint-config-ts';
|
|
35
|
+
|
|
36
|
+
export default createConfig({
|
|
37
|
+
files: ['src/**/*.ts', 'lib/**/*.ts'],
|
|
38
|
+
ignores: ['dist/**', 'build/**'],
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Defaults
|
|
43
|
+
|
|
44
|
+
| Option | Default |
|
|
45
|
+
| --------- | ---------------------------------- |
|
|
46
|
+
| `files` | `['src/**/*.{js,ts}']` |
|
|
47
|
+
| `ignores` | `['dist/**', 'node_modules/**']` |
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAC,EAC3B,KAA4B,EAC5B,OAAwC,GACzC,GAAE;IACD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACf,oCAqCL"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineConfig } from 'eslint/config';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
import tseslint from 'typescript-eslint';
|
|
4
|
+
import eslint from '@eslint/js';
|
|
5
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
6
|
+
export function createConfig({ files = ['src/**/*.{js,ts}'], ignores = ['dist/**', 'node_modules/**'], } = {}) {
|
|
7
|
+
return defineConfig([
|
|
8
|
+
{
|
|
9
|
+
extends: [
|
|
10
|
+
eslint.configs.recommended,
|
|
11
|
+
tseslint.configs.recommended,
|
|
12
|
+
],
|
|
13
|
+
files,
|
|
14
|
+
ignores,
|
|
15
|
+
plugins: {
|
|
16
|
+
'@stylistic': stylistic,
|
|
17
|
+
},
|
|
18
|
+
languageOptions: {
|
|
19
|
+
globals: globals.node,
|
|
20
|
+
parserOptions: {
|
|
21
|
+
projectService: true,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
'@stylistic/comma-dangle': ['error', {
|
|
26
|
+
arrays: 'always-multiline',
|
|
27
|
+
objects: 'always-multiline',
|
|
28
|
+
imports: 'always-multiline',
|
|
29
|
+
exports: 'always-multiline',
|
|
30
|
+
functions: 'always-multiline',
|
|
31
|
+
}],
|
|
32
|
+
'@stylistic/eol-last': 'error',
|
|
33
|
+
'@stylistic/indent': ['error', 2, { 'SwitchCase': 1 }],
|
|
34
|
+
'@stylistic/no-trailing-spaces': 'error',
|
|
35
|
+
'@stylistic/semi': 'error',
|
|
36
|
+
'@typescript-eslint/no-unused-vars': ['error', {
|
|
37
|
+
varsIgnorePattern: '^_',
|
|
38
|
+
argsIgnorePattern: '^_',
|
|
39
|
+
}],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EA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"@abelspithost/eslint-config-ts",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "ESLint configuration preset",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Abel Spithost",
|
|
7
|
+
"url": "https://github.com/aspithost"
|
|
8
|
+
},
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/aspithost/eslint-config-ts.git"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "npm run clean && tsc -p tsconfig.json",
|
|
26
|
+
"clean": "rimraf dist"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@eslint/js": "^9.39.2",
|
|
30
|
+
"@stylistic/eslint-plugin": "^5.7.1",
|
|
31
|
+
"globals": "^17.3.0",
|
|
32
|
+
"typescript-eslint": "^8.54.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@abelspithost/tsconfig-node": "^0.0.3",
|
|
36
|
+
"@types/node": "^24.10.11",
|
|
37
|
+
"rimraf": "^6.1.2",
|
|
38
|
+
"typescript": "^5.9.3"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"eslint": ">=9.0.0",
|
|
42
|
+
"typescript": ">=5.0.0"
|
|
43
|
+
}
|
|
44
|
+
}
|