@cedarjs/eslint-config 5.0.7-next.338 → 5.0.7
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 +43 -14
- package/dist/index.d.mts +1 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +144 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/shared.d.mts +2 -3
- package/dist/shared.d.mts.map +1 -1
- package/dist/shared.d.ts +144 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/index.js +142 -0
- package/index.mjs +2 -3
- package/package.json +31 -11
- package/shared.js +202 -0
- package/shared.mjs +1 -6
package/README.md
CHANGED
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
- [Purpose and Vision](#purpose-and-vision)
|
|
7
7
|
- [Roadmap](#roadmap)
|
|
8
8
|
- [Contributing](#contributing)
|
|
9
|
-
- [Usage](#usage)
|
|
10
|
-
- [Overriding Default Configuration](#overriding-default-configuration)
|
|
11
|
-
- [
|
|
9
|
+
- [Usage (Flat Config - Recommended)](#usage-flat-config---recommended)
|
|
10
|
+
- [Overriding Default Configuration (Flat Config)](#overriding-default-configuration-flat-config)
|
|
11
|
+
- [Migration Guide (Optional)](#migration-guide-optional)
|
|
12
|
+
- [Legacy Configuration (Still Supported)](#legacy-configuration-still-supported)
|
|
12
13
|
|
|
13
14
|
## Purpose and Vision
|
|
14
15
|
|
|
@@ -31,12 +32,12 @@ Our configuration uses recommended rule presets, including those from [ESLint](h
|
|
|
31
32
|
|
|
32
33
|
This package doesn't depend on other CedarJS Framework packages. To contribute, you should be familiar with the ESLint package. Keep in mind that any rules added should not conflict with code formatting tools (e.g. [Prettier](https://prettier.io/docs/en/integrating-with-linters.html)).
|
|
33
34
|
|
|
34
|
-
## Usage
|
|
35
|
+
## Usage (Flat Config - Recommended)
|
|
35
36
|
|
|
36
|
-
CedarJS uses ESLint's flat config format by default. Create an `eslint.config.
|
|
37
|
+
CedarJS uses ESLint's flat config format by default. Create an `eslint.config.js` file in your project root:
|
|
37
38
|
|
|
38
39
|
```javascript
|
|
39
|
-
// cedar-app/eslint.config.
|
|
40
|
+
// cedar-app/eslint.config.js
|
|
40
41
|
import cedarConfig from '@cedarjs/eslint-config'
|
|
41
42
|
|
|
42
43
|
export default await cedarConfig()
|
|
@@ -44,12 +45,12 @@ export default await cedarConfig()
|
|
|
44
45
|
|
|
45
46
|
Note: The config is async because it needs to load your Cedar project configuration.
|
|
46
47
|
|
|
47
|
-
## Overriding Default Configuration
|
|
48
|
+
## Overriding Default Configuration (Flat Config)
|
|
48
49
|
|
|
49
50
|
To override rules in your CedarJS app, add additional config objects after the Cedar config:
|
|
50
51
|
|
|
51
52
|
```javascript
|
|
52
|
-
// cedar-app/eslint.config.
|
|
53
|
+
// cedar-app/eslint.config.js
|
|
53
54
|
import cedarConfig from '@cedarjs/eslint-config'
|
|
54
55
|
|
|
55
56
|
export default [
|
|
@@ -66,7 +67,7 @@ export default [
|
|
|
66
67
|
You can also add file-specific overrides:
|
|
67
68
|
|
|
68
69
|
```javascript
|
|
69
|
-
// cedar-app/eslint.config.
|
|
70
|
+
// cedar-app/eslint.config.js
|
|
70
71
|
import cedarConfig from '@cedarjs/eslint-config'
|
|
71
72
|
|
|
72
73
|
export default [
|
|
@@ -83,7 +84,7 @@ export default [
|
|
|
83
84
|
To ignore specific files or directories:
|
|
84
85
|
|
|
85
86
|
```javascript
|
|
86
|
-
// cedar-app/eslint.config.
|
|
87
|
+
// cedar-app/eslint.config.js
|
|
87
88
|
import cedarConfig from '@cedarjs/eslint-config'
|
|
88
89
|
|
|
89
90
|
export default [
|
|
@@ -94,15 +95,15 @@ export default [
|
|
|
94
95
|
]
|
|
95
96
|
```
|
|
96
97
|
|
|
97
|
-
##
|
|
98
|
+
## Migration Guide (Optional)
|
|
98
99
|
|
|
99
|
-
**The legacy `.eslintrc.js
|
|
100
|
+
**The legacy `.eslintrc.js` format still works** - you don't have to migrate. However, if you want to use the new flat config format, follow these steps:
|
|
100
101
|
|
|
101
102
|
1. **Create a new flat config file** in your project root:
|
|
102
103
|
|
|
103
104
|
```javascript
|
|
104
|
-
// eslint.config.mjs (
|
|
105
|
-
// "type": "module")
|
|
105
|
+
// eslint.config.mjs (for CommonJS projects)
|
|
106
|
+
// or eslint.config.js (for ESM projects with "type": "module")
|
|
106
107
|
import cedarConfig from '@cedarjs/eslint-config'
|
|
107
108
|
|
|
108
109
|
export default await cedarConfig()
|
|
@@ -136,3 +137,31 @@ export default [
|
|
|
136
137
|
```
|
|
137
138
|
|
|
138
139
|
That's it! Your linting should work the same as before.
|
|
140
|
+
|
|
141
|
+
## Legacy Configuration (Still Supported)
|
|
142
|
+
|
|
143
|
+
The legacy `.eslintrc.js` format is still fully supported. You can continue using it:
|
|
144
|
+
|
|
145
|
+
```javascript
|
|
146
|
+
// cedar-app/.eslintrc.js
|
|
147
|
+
module.exports = {
|
|
148
|
+
extends: ['@cedarjs/eslint-config'],
|
|
149
|
+
root: true,
|
|
150
|
+
rules: {
|
|
151
|
+
'jsx-a11y/no-onchange': 'off',
|
|
152
|
+
},
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Or in `package.json`:
|
|
157
|
+
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"eslintConfig": {
|
|
161
|
+
"extends": "@cedarjs/eslint-config",
|
|
162
|
+
"root": true
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Note:** While both formats are supported, we recommend migrating to flat config when convenient. See the [Migration Guide](#migration-guide-optional) above.
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../index.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../index.mjs"],"names":[],"mappings":"AAkBA,uDAkKC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
declare const plugins_1: any[];
|
|
2
|
+
export const rules: {
|
|
3
|
+
'react-compiler/react-compiler': number;
|
|
4
|
+
};
|
|
5
|
+
declare let _extends: (string | false)[];
|
|
6
|
+
export declare let ignorePatterns: string[];
|
|
7
|
+
export declare namespace parserOptions {
|
|
8
|
+
let requireConfigFile: boolean;
|
|
9
|
+
namespace babelOptions {
|
|
10
|
+
let plugins: [string, import("@babel/core").PluginOptions][];
|
|
11
|
+
let overrides: ({
|
|
12
|
+
presets: import("@babel/core").PluginItem[] | null | undefined;
|
|
13
|
+
plugins: ([import("@babel/core").PluginTarget, import("@babel/core").PluginOptions, string | undefined] | [import("@babel/core").PluginTarget, import("@babel/core").PluginOptions])[];
|
|
14
|
+
extends: string | undefined;
|
|
15
|
+
babelrc: boolean;
|
|
16
|
+
ignore: string[];
|
|
17
|
+
test: string[];
|
|
18
|
+
} | {
|
|
19
|
+
presets: ((string | undefined)[] | (string | object)[])[];
|
|
20
|
+
plugins: import("@babel/core").TransformOptions[];
|
|
21
|
+
extends: string | undefined;
|
|
22
|
+
babelrc: boolean;
|
|
23
|
+
ignore: string[];
|
|
24
|
+
test: string[];
|
|
25
|
+
})[];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
declare let overrides_1: ({
|
|
29
|
+
files: string[];
|
|
30
|
+
rules: {
|
|
31
|
+
'no-undef': string;
|
|
32
|
+
'jsx-a11y/aria-role': (number | {
|
|
33
|
+
ignoreNonDOM: boolean;
|
|
34
|
+
})[];
|
|
35
|
+
'@cedarjs/unsupported-route-components': string;
|
|
36
|
+
'@cedarjs/service-type-annotations'?: undefined;
|
|
37
|
+
};
|
|
38
|
+
env?: undefined;
|
|
39
|
+
globals?: undefined;
|
|
40
|
+
plugins?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
files: string;
|
|
43
|
+
env: {
|
|
44
|
+
node: boolean;
|
|
45
|
+
es6: boolean;
|
|
46
|
+
commonjs?: undefined;
|
|
47
|
+
browser?: undefined;
|
|
48
|
+
'shared-node-browser'?: undefined;
|
|
49
|
+
};
|
|
50
|
+
globals: {
|
|
51
|
+
gql: string;
|
|
52
|
+
context: string;
|
|
53
|
+
Promise?: undefined;
|
|
54
|
+
React?: undefined;
|
|
55
|
+
process?: undefined;
|
|
56
|
+
require?: undefined;
|
|
57
|
+
mockGraphQLQuery?: undefined;
|
|
58
|
+
mockGraphQLMutation?: undefined;
|
|
59
|
+
mockCurrentUser?: undefined;
|
|
60
|
+
scenario?: undefined;
|
|
61
|
+
defineScenario?: undefined;
|
|
62
|
+
};
|
|
63
|
+
rules?: undefined;
|
|
64
|
+
plugins?: undefined;
|
|
65
|
+
} | {
|
|
66
|
+
files: string[];
|
|
67
|
+
plugins: string[];
|
|
68
|
+
rules: {
|
|
69
|
+
'@cedarjs/service-type-annotations': string;
|
|
70
|
+
'no-undef'?: undefined;
|
|
71
|
+
'jsx-a11y/aria-role'?: undefined;
|
|
72
|
+
'@cedarjs/unsupported-route-components'?: undefined;
|
|
73
|
+
};
|
|
74
|
+
env?: undefined;
|
|
75
|
+
globals?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
files: string[];
|
|
78
|
+
env: {
|
|
79
|
+
node: boolean;
|
|
80
|
+
commonjs: boolean;
|
|
81
|
+
es6?: undefined;
|
|
82
|
+
browser?: undefined;
|
|
83
|
+
'shared-node-browser'?: undefined;
|
|
84
|
+
};
|
|
85
|
+
globals: {
|
|
86
|
+
Promise: string;
|
|
87
|
+
gql?: undefined;
|
|
88
|
+
context?: undefined;
|
|
89
|
+
React?: undefined;
|
|
90
|
+
process?: undefined;
|
|
91
|
+
require?: undefined;
|
|
92
|
+
mockGraphQLQuery?: undefined;
|
|
93
|
+
mockGraphQLMutation?: undefined;
|
|
94
|
+
mockCurrentUser?: undefined;
|
|
95
|
+
scenario?: undefined;
|
|
96
|
+
defineScenario?: undefined;
|
|
97
|
+
};
|
|
98
|
+
rules?: undefined;
|
|
99
|
+
plugins?: undefined;
|
|
100
|
+
} | {
|
|
101
|
+
files: string;
|
|
102
|
+
env: {
|
|
103
|
+
browser: boolean;
|
|
104
|
+
es6: boolean;
|
|
105
|
+
'shared-node-browser': boolean;
|
|
106
|
+
node?: undefined;
|
|
107
|
+
commonjs?: undefined;
|
|
108
|
+
};
|
|
109
|
+
globals: {
|
|
110
|
+
React: string;
|
|
111
|
+
gql: string;
|
|
112
|
+
process: string;
|
|
113
|
+
require: string;
|
|
114
|
+
context?: undefined;
|
|
115
|
+
Promise?: undefined;
|
|
116
|
+
mockGraphQLQuery?: undefined;
|
|
117
|
+
mockGraphQLMutation?: undefined;
|
|
118
|
+
mockCurrentUser?: undefined;
|
|
119
|
+
scenario?: undefined;
|
|
120
|
+
defineScenario?: undefined;
|
|
121
|
+
};
|
|
122
|
+
rules?: undefined;
|
|
123
|
+
plugins?: undefined;
|
|
124
|
+
} | {
|
|
125
|
+
files: string[];
|
|
126
|
+
globals: {
|
|
127
|
+
mockGraphQLQuery: string;
|
|
128
|
+
mockGraphQLMutation: string;
|
|
129
|
+
mockCurrentUser: string;
|
|
130
|
+
scenario: string;
|
|
131
|
+
defineScenario: string;
|
|
132
|
+
gql?: undefined;
|
|
133
|
+
context?: undefined;
|
|
134
|
+
Promise?: undefined;
|
|
135
|
+
React?: undefined;
|
|
136
|
+
process?: undefined;
|
|
137
|
+
require?: undefined;
|
|
138
|
+
};
|
|
139
|
+
rules?: undefined;
|
|
140
|
+
env?: undefined;
|
|
141
|
+
plugins?: undefined;
|
|
142
|
+
})[];
|
|
143
|
+
export { _extends as extends, plugins, overrides_1 as overrides };
|
|
144
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.js"],"names":[],"mappings":"AAyCA,+BAAkB;AAClB;;EAAgB"}
|
package/dist/shared.d.mts
CHANGED
package/dist/shared.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../shared.mjs"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../shared.mjs"],"names":[],"mappings":""}
|
package/dist/shared.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
declare let _extends: string[];
|
|
2
|
+
export { _extends as extends };
|
|
3
|
+
export declare let parser: string;
|
|
4
|
+
export declare let plugins: string[];
|
|
5
|
+
export declare let ignorePatterns: string[];
|
|
6
|
+
export declare let settings: {
|
|
7
|
+
react: {
|
|
8
|
+
version: string;
|
|
9
|
+
};
|
|
10
|
+
'import-x/internal-regex': string;
|
|
11
|
+
};
|
|
12
|
+
export declare let rules: {
|
|
13
|
+
'@cedarjs/process-env-computed': string;
|
|
14
|
+
'prettier/prettier': string;
|
|
15
|
+
'no-console': string;
|
|
16
|
+
'prefer-object-spread': string;
|
|
17
|
+
'prefer-spread': string;
|
|
18
|
+
'no-unused-expressions': (string | {
|
|
19
|
+
allowShortCircuit: boolean;
|
|
20
|
+
allowTernary: boolean;
|
|
21
|
+
})[];
|
|
22
|
+
'no-useless-escape': string;
|
|
23
|
+
camelcase: (string | {
|
|
24
|
+
properties: string;
|
|
25
|
+
})[];
|
|
26
|
+
'no-new': string;
|
|
27
|
+
'new-cap': (string | {
|
|
28
|
+
newIsCap: boolean;
|
|
29
|
+
capIsNew: boolean;
|
|
30
|
+
})[];
|
|
31
|
+
'no-unused-vars': (string | {
|
|
32
|
+
varsIgnorePattern: string;
|
|
33
|
+
argsIgnorePattern: string;
|
|
34
|
+
})[];
|
|
35
|
+
'react/prop-types': string;
|
|
36
|
+
'react/display-name': string;
|
|
37
|
+
'react-hooks/exhaustive-deps': string;
|
|
38
|
+
'import-x/order': (string | {
|
|
39
|
+
'newlines-between': string;
|
|
40
|
+
pathGroupsExcludedImportTypes: never[];
|
|
41
|
+
groups: string[];
|
|
42
|
+
pathGroups: ({
|
|
43
|
+
pattern: string;
|
|
44
|
+
group: string;
|
|
45
|
+
position: string;
|
|
46
|
+
patternOptions?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
pattern: string;
|
|
49
|
+
patternOptions: {
|
|
50
|
+
nobrace: boolean;
|
|
51
|
+
noglobstar: boolean;
|
|
52
|
+
};
|
|
53
|
+
group: string;
|
|
54
|
+
position: string;
|
|
55
|
+
})[];
|
|
56
|
+
alphabetize: {
|
|
57
|
+
order: string;
|
|
58
|
+
caseInsensitive: boolean;
|
|
59
|
+
};
|
|
60
|
+
})[];
|
|
61
|
+
'no-restricted-imports': (string | {
|
|
62
|
+
patterns: {
|
|
63
|
+
group: string[];
|
|
64
|
+
message: string;
|
|
65
|
+
}[];
|
|
66
|
+
})[];
|
|
67
|
+
};
|
|
68
|
+
export declare let overrides: ({
|
|
69
|
+
files: string[];
|
|
70
|
+
excludedFiles: string[];
|
|
71
|
+
rules: {
|
|
72
|
+
'react-hooks/rules-of-hooks': string;
|
|
73
|
+
'@typescript-eslint/no-empty-function'?: undefined;
|
|
74
|
+
'@typescript-eslint/prefer-function-type'?: undefined;
|
|
75
|
+
'@typescript-eslint/no-var-requires'?: undefined;
|
|
76
|
+
'@typescript-eslint/no-require-imports'?: undefined;
|
|
77
|
+
'@typescript-eslint/no-empty-object-type'?: undefined;
|
|
78
|
+
'@typescript-eslint/no-unused-vars'?: undefined;
|
|
79
|
+
'no-restricted-imports'?: undefined;
|
|
80
|
+
};
|
|
81
|
+
parser?: undefined;
|
|
82
|
+
extends?: undefined;
|
|
83
|
+
env?: undefined;
|
|
84
|
+
} | {
|
|
85
|
+
files: string[];
|
|
86
|
+
parser: string;
|
|
87
|
+
extends: string[];
|
|
88
|
+
rules: {
|
|
89
|
+
'@typescript-eslint/no-empty-function': string;
|
|
90
|
+
'@typescript-eslint/prefer-function-type': string;
|
|
91
|
+
'@typescript-eslint/no-var-requires': string;
|
|
92
|
+
'@typescript-eslint/no-require-imports': string;
|
|
93
|
+
'@typescript-eslint/no-empty-object-type': string;
|
|
94
|
+
'@typescript-eslint/no-unused-vars': (string | {
|
|
95
|
+
varsIgnorePattern: string;
|
|
96
|
+
argsIgnorePattern: string;
|
|
97
|
+
})[];
|
|
98
|
+
'react-hooks/rules-of-hooks'?: undefined;
|
|
99
|
+
'no-restricted-imports'?: undefined;
|
|
100
|
+
};
|
|
101
|
+
excludedFiles?: undefined;
|
|
102
|
+
env?: undefined;
|
|
103
|
+
} | {
|
|
104
|
+
files: string[];
|
|
105
|
+
env: {
|
|
106
|
+
node: boolean;
|
|
107
|
+
es6: boolean;
|
|
108
|
+
commonjs: boolean;
|
|
109
|
+
jest: boolean;
|
|
110
|
+
};
|
|
111
|
+
excludedFiles?: undefined;
|
|
112
|
+
rules?: undefined;
|
|
113
|
+
parser?: undefined;
|
|
114
|
+
extends?: undefined;
|
|
115
|
+
} | {
|
|
116
|
+
files: string[];
|
|
117
|
+
env: {
|
|
118
|
+
node: boolean;
|
|
119
|
+
commonjs: boolean;
|
|
120
|
+
jest: boolean;
|
|
121
|
+
es6?: undefined;
|
|
122
|
+
};
|
|
123
|
+
excludedFiles?: undefined;
|
|
124
|
+
rules?: undefined;
|
|
125
|
+
parser?: undefined;
|
|
126
|
+
extends?: undefined;
|
|
127
|
+
} | {
|
|
128
|
+
files: string[];
|
|
129
|
+
rules: {
|
|
130
|
+
'no-restricted-imports': string;
|
|
131
|
+
'react-hooks/rules-of-hooks'?: undefined;
|
|
132
|
+
'@typescript-eslint/no-empty-function'?: undefined;
|
|
133
|
+
'@typescript-eslint/prefer-function-type'?: undefined;
|
|
134
|
+
'@typescript-eslint/no-var-requires'?: undefined;
|
|
135
|
+
'@typescript-eslint/no-require-imports'?: undefined;
|
|
136
|
+
'@typescript-eslint/no-empty-object-type'?: undefined;
|
|
137
|
+
'@typescript-eslint/no-unused-vars'?: undefined;
|
|
138
|
+
};
|
|
139
|
+
excludedFiles?: undefined;
|
|
140
|
+
parser?: undefined;
|
|
141
|
+
extends?: undefined;
|
|
142
|
+
env?: undefined;
|
|
143
|
+
})[];
|
|
144
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../shared.js"],"names":[],"mappings":""}
|