@frsource/eslint-config 1.9.0 → 1.11.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/README.md +10 -0
- package/index.d.mts +1 -0
- package/index.mjs +4 -0
- package/javascript.d.mts +4 -0
- package/javascript.mjs +51 -0
- package/package.json +3 -3
- package/typescript.mjs +3 -33
package/README.md
CHANGED
|
@@ -6,8 +6,18 @@ ESLint configuration files used across the FRSOURCE organization.
|
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
+
### typescript
|
|
10
|
+
|
|
9
11
|
```js
|
|
10
12
|
// eslint.config.mjs
|
|
11
13
|
|
|
12
14
|
export { typescript as default } from '@frsource/eslint-config';
|
|
13
15
|
```
|
|
16
|
+
|
|
17
|
+
### javascript
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
// eslint.config.mjs
|
|
21
|
+
|
|
22
|
+
export { javascript as default } from '@frsource/eslint-config';
|
|
23
|
+
```
|
package/index.d.mts
CHANGED
package/index.mjs
CHANGED
package/javascript.d.mts
ADDED
package/javascript.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import prettier from 'eslint-config-prettier';
|
|
2
|
+
import js from '@eslint/js';
|
|
3
|
+
import globals from 'globals';
|
|
4
|
+
import { env } from 'node:process';
|
|
5
|
+
|
|
6
|
+
/** @type { import("eslint").Linter.FlatConfig[] } */
|
|
7
|
+
export const overrides = [
|
|
8
|
+
{
|
|
9
|
+
rules: {
|
|
10
|
+
semi: 0,
|
|
11
|
+
curly: 0,
|
|
12
|
+
indent: ['off', 2, { offsetTernaryExpressions: true }],
|
|
13
|
+
'comma-dangle': 'off',
|
|
14
|
+
'arrow-parens': [
|
|
15
|
+
'off',
|
|
16
|
+
'as-needed',
|
|
17
|
+
{
|
|
18
|
+
requireForBlockBody: true,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
'space-before-function-paren': [
|
|
22
|
+
'error',
|
|
23
|
+
{
|
|
24
|
+
anonymous: 'always',
|
|
25
|
+
named: 'never',
|
|
26
|
+
asyncArrow: 'always',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
'func-call-spacing': 0,
|
|
30
|
+
'no-console': 'error',
|
|
31
|
+
'no-debugger': env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
files: ['.*.{js,cjs,mjs,jsx}', '*.config.{js,cjs,mjs,jsx}'],
|
|
36
|
+
languageOptions: {
|
|
37
|
+
globals: {
|
|
38
|
+
...globals.node,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
files: ['**/*.cjs'],
|
|
44
|
+
rules: {
|
|
45
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
/** @type { import("eslint").Linter.FlatConfig[] } */
|
|
51
|
+
export default [js.configs.recommended, prettier, ...overrides];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frsource/eslint-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"main": "index.mjs",
|
|
5
5
|
"types": "index.d.mts",
|
|
6
6
|
"type": "module",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"eslint": "^9.1.0",
|
|
18
18
|
"release-it": "^17.2.0",
|
|
19
19
|
"typescript": "^5.4.5",
|
|
20
|
-
"@frsource/prettier-config": "1.
|
|
21
|
-
"@frsource/release-it-config": "1.
|
|
20
|
+
"@frsource/prettier-config": "1.7.0",
|
|
21
|
+
"@frsource/release-it-config": "1.11.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"eslint": ">= 9",
|
package/typescript.mjs
CHANGED
|
@@ -2,54 +2,24 @@ import prettier from 'eslint-config-prettier';
|
|
|
2
2
|
import js from '@eslint/js';
|
|
3
3
|
import ts from 'typescript-eslint';
|
|
4
4
|
import globals from 'globals';
|
|
5
|
-
import {
|
|
5
|
+
import { overrides as javascriptOverrides } from './javascript.mjs';
|
|
6
6
|
|
|
7
7
|
/** @type { import("eslint").Linter.FlatConfig[] } */
|
|
8
8
|
export const overrides = [
|
|
9
9
|
{
|
|
10
10
|
rules: {
|
|
11
11
|
'@typescript-eslint/semi': 2,
|
|
12
|
-
semi: 0,
|
|
13
|
-
curly: 0,
|
|
14
|
-
indent: ['off', 2, { offsetTernaryExpressions: true }],
|
|
15
|
-
'comma-dangle': 'off',
|
|
16
|
-
'arrow-parens': [
|
|
17
|
-
'off',
|
|
18
|
-
'as-needed',
|
|
19
|
-
{
|
|
20
|
-
requireForBlockBody: true,
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
'space-before-function-paren': [
|
|
24
|
-
'error',
|
|
25
|
-
{
|
|
26
|
-
anonymous: 'always',
|
|
27
|
-
named: 'never',
|
|
28
|
-
asyncArrow: 'always',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
'func-call-spacing': 0,
|
|
32
|
-
'no-console': 'error',
|
|
33
|
-
'no-debugger': env.NODE_ENV === 'production' ? 'error' : 'off',
|
|
34
12
|
},
|
|
35
13
|
},
|
|
36
14
|
{
|
|
37
|
-
files: [
|
|
38
|
-
'.*.{js,cjs,mjs,ts,mts,tsx,jsx}',
|
|
39
|
-
'*.config.{js,cjs,mjs,ts,mts,tsx,jsx}',
|
|
40
|
-
],
|
|
15
|
+
files: ['.*.{ts,mts,tsx}', '*.config.{ts,mts,tsx}'],
|
|
41
16
|
languageOptions: {
|
|
42
17
|
globals: {
|
|
43
18
|
...globals.node,
|
|
44
19
|
},
|
|
45
20
|
},
|
|
46
21
|
},
|
|
47
|
-
|
|
48
|
-
files: ['**/*.cjs'],
|
|
49
|
-
rules: {
|
|
50
|
-
'@typescript-eslint/no-var-requires': 'off',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
22
|
+
...javascriptOverrides,
|
|
53
23
|
];
|
|
54
24
|
|
|
55
25
|
/** @type {import('typescript-eslint')['config']} */
|