Skip to content

Commit ff4bdf1

Browse files
chore(deps): update dependency prettier to v3 (#224)
* chore(deps): update dependency prettier to v3 * fix --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Yosuke Ota <otameshiyo23@gmail.com>
1 parent b3e4933 commit ff4bdf1

37 files changed

+186
-180
lines changed

docs/.vuepress/components/components/EslintPluginEditor.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,26 +164,26 @@ export default {
164164
monaco.languages.register({ id: "toml" });
165165
monaco.languages.setMonarchTokensProvider(
166166
"toml",
167-
require("./languages/toml/toml").language
167+
require("./languages/toml/toml").language,
168168
);
169169
170170
monaco.languages.register({ id: "yaml" });
171171
monaco.languages.setMonarchTokensProvider(
172172
"yaml",
173-
require("monaco-editor/esm/vs/basic-languages/yaml/yaml").language
173+
require("monaco-editor/esm/vs/basic-languages/yaml/yaml").language,
174174
);
175175
});
176176
editor.$watch("codeEditor", () => {
177177
if (editor.codeEditor) {
178178
editor.codeEditor.onDidChangeModelDecorations(() =>
179-
this.onDidChangeModelDecorations(editor.codeEditor)
179+
this.onDidChangeModelDecorations(editor.codeEditor),
180180
);
181181
}
182182
});
183183
editor.$watch("fixedCodeEditor", () => {
184184
if (editor.fixedCodeEditor) {
185185
editor.fixedCodeEditor.onDidChangeModelDecorations(() =>
186-
this.onDidChangeModelDecorations(editor.fixedCodeEditor)
186+
this.onDidChangeModelDecorations(editor.fixedCodeEditor),
187187
);
188188
}
189189
});

docs/.vuepress/components/rules/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ for (const k of Object.keys(coreRules)) {
5252
}
5353

5454
allRules.sort((a, b) =>
55-
a.ruleId > b.ruleId ? 1 : a.ruleId < b.ruleId ? -1 : 0
55+
a.ruleId > b.ruleId ? 1 : a.ruleId < b.ruleId ? -1 : 0,
5656
);
5757

5858
export const categories = [];
@@ -81,7 +81,7 @@ categories.sort((a, b) =>
8181
? 1
8282
: a.title < b.title
8383
? -1
84-
: 0
84+
: 0,
8585
);
8686

8787
export const DEFAULT_RULES_CONFIG = allRules.reduce((c, r) => {

docs/.vuepress/components/state/serialize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function serializeState(state) {
3737
`The compress rate of serialized string: ${(
3838
(100 * base64.length) /
3939
jsonString.length
40-
).toFixed(1)}% (${jsonString.length}B → ${base64.length}B)`
40+
).toFixed(1)}% (${jsonString.length}B → ${base64.length}B)`,
4141
);
4242

4343
return base64;

docs/.vuepress/config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,31 @@ module.exports = {
3434
eslint$: path.resolve(__dirname, "./shim/eslint"),
3535
"eslint-visitor-keys$": path.resolve(
3636
__dirname,
37-
"./shim/eslint-visitor-keys"
37+
"./shim/eslint-visitor-keys",
3838
),
3939
ajv: path.resolve(
4040
require.resolve("eslint/package.json"),
41-
"../node_modules/ajv"
41+
"../node_modules/ajv",
4242
),
4343
[path.resolve(__dirname, "../../lib/utils/ajv")]: path.resolve(
4444
__dirname,
45-
"../../node_modules/ajv"
45+
"../../node_modules/ajv",
4646
),
4747
synckit: require.resolve("./shim/synckit"),
4848
// Adjust the yaml path as it gets confusing.
4949
yaml$: path.resolve(
5050
__dirname,
51-
"../../node_modules/yaml/dist/index.js"
51+
"../../node_modules/yaml/dist/index.js",
5252
),
5353
// Adjust the esquery path as it gets confusing.
5454
esquery: path.resolve(
5555
__dirname,
56-
"../../node_modules/esquery/dist/esquery.min.js"
56+
"../../node_modules/esquery/dist/esquery.min.js",
5757
),
5858
// Adjust the @eslint/eslintrc path as it gets confusing.
5959
"@eslint/eslintrc/universal": path.resolve(
6060
__dirname,
61-
"../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs"
61+
"../../node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs",
6262
),
6363
},
6464
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"eslint-plugin-markdown": "^3.0.0",
8888
"eslint-plugin-node": "^11.1.0",
8989
"eslint-plugin-node-dependencies": "^0.11.0",
90-
"eslint-plugin-prettier": "^4.0.0",
90+
"eslint-plugin-prettier": "^5.0.0",
9191
"eslint-plugin-regexp": "^1.0.0",
9292
"eslint-plugin-toml": "^0.5.0",
9393
"eslint-plugin-vue": "^9.0.0",
@@ -96,7 +96,7 @@
9696
"mocha": "^10.0.0",
9797
"monaco-editor": "^0.40.0",
9898
"nyc": "^15.1.0",
99-
"prettier": "^2.2.1",
99+
"prettier": "^3.0.0",
100100
"prettier-plugin-pkg": "^0.17.0",
101101
"raw-loader": "^4.0.1",
102102
"request": "^2.88.2",

src/index.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ const configs = {
99
recommended,
1010
};
1111

12-
const rules = ruleList.reduce((obj, r) => {
13-
obj[r.meta.docs.ruleName] = r;
14-
return obj;
15-
}, {} as { [key: string]: RuleModule });
12+
const rules = ruleList.reduce(
13+
(obj, r) => {
14+
obj[r.meta.docs.ruleName] = r;
15+
return obj;
16+
},
17+
{} as { [key: string]: RuleModule },
18+
);
1619

1720
export = {
1821
meta,

src/rules/no-invalid.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function parseOption(
5555
}
5656
| string,
5757
context: RuleContext,
58-
filename: string
58+
filename: string,
5959
): Validator | null {
6060
if (typeof option === "string") {
6161
return schemaPathToValidator(option, context);
@@ -127,7 +127,7 @@ function parseOption(
127127
*/
128128
function schemaPathToValidator(
129129
schemaPath: string,
130-
context: RuleContext
130+
context: RuleContext,
131131
): Validator | null {
132132
const schema = loadSchema(schemaPath, context);
133133
if (!schema) {
@@ -141,7 +141,7 @@ function schemaPathToValidator(
141141
*/
142142
function schemaObjectToValidator(
143143
schema: SchemaObject | null,
144-
context: RuleContext
144+
context: RuleContext,
145145
): Validator | null {
146146
if (!schema) {
147147
return null;
@@ -228,7 +228,7 @@ export default createRule("no-invalid", {
228228
const v = parseOption(
229229
context.options[0] || {},
230230
context,
231-
filename.startsWith(cwd) ? path.relative(cwd, filename) : filename
231+
filename.startsWith(cwd) ? path.relative(cwd, filename) : filename,
232232
);
233233
if (!v) {
234234
return {};
@@ -244,7 +244,7 @@ export default createRule("no-invalid", {
244244
*/
245245
function validateData(
246246
data: unknown,
247-
resolveLoc: (error: ValidateError) => JSONAST.SourceLocation | null
247+
resolveLoc: (error: ValidateError) => JSONAST.SourceLocation | null,
248248
) {
249249
const errors = validator!(data);
250250
for (const error of errors) {
@@ -267,7 +267,7 @@ export default createRule("no-invalid", {
267267
*/
268268
function validateJSExport(
269269
node: ESLintExpression,
270-
rootRange: [number, number]
270+
rootRange: [number, number],
271271
) {
272272
if (existsExports) {
273273
return;
@@ -371,7 +371,7 @@ export default createRule("no-invalid", {
371371
* ErrorData to report location.
372372
*/
373373
function errorDataToLoc(
374-
errorData: NodeData<JSONAST.JSONNode | YAML.YAMLNode | TOML.TOMLNode>
374+
errorData: NodeData<JSONAST.JSONNode | YAML.YAMLNode | TOML.TOMLNode>,
375375
) {
376376
if (errorData.key) {
377377
const range = errorData.key(sourceCode);
@@ -439,9 +439,9 @@ export default createRule("no-invalid", {
439439
path.dirname(
440440
typeof context.getPhysicalFilename === "function"
441441
? context.getPhysicalFilename()
442-
: getPhysicalFilename(context.getFilename())
442+
: getPhysicalFilename(context.getFilename()),
443443
),
444-
$schema
444+
$schema,
445445
)
446446
: $schema
447447
: null;

src/types.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface PartialRuleModule {
3838
meta: PartialRuleMetaData;
3939
create(
4040
context: RuleContext,
41-
params: { customBlock: boolean; filename: string }
41+
params: { customBlock: boolean; filename: string },
4242
): RuleListener;
4343
}
4444

@@ -109,7 +109,7 @@ export interface SourceCode {
109109
getText(
110110
node?: NodeOrToken,
111111
beforeCount?: number,
112-
afterCount?: number
112+
afterCount?: number,
113113
): string;
114114

115115
getLines(): string[];
@@ -131,7 +131,7 @@ export interface SourceCode {
131131

132132
getTokenByRangeStart(
133133
offset: number,
134-
options?: { includeComments?: boolean }
134+
options?: { includeComments?: boolean },
135135
): Token | null;
136136

137137
getFirstToken(node: Node): Token;
@@ -147,53 +147,53 @@ export interface SourceCode {
147147
// getTokenBefore(node: NodeOrToken): Token | null
148148
getTokenBefore(
149149
node: NodeOrToken,
150-
options?: CursorWithSkipOptions
150+
options?: CursorWithSkipOptions,
151151
): Token | null;
152152

153153
getTokensBefore(node: NodeOrToken, options?: CursorWithCountOptions): Token[];
154154

155155
// getTokenAfter(node: NodeOrToken): Token | null
156156
getTokenAfter(
157157
node: NodeOrToken,
158-
options?: CursorWithSkipOptions
158+
options?: CursorWithSkipOptions,
159159
): Token | null;
160160

161161
getTokensAfter(node: NodeOrToken, options?: CursorWithCountOptions): Token[];
162162

163163
getFirstTokenBetween(
164164
left: NodeOrToken,
165165
right: NodeOrToken,
166-
options?: CursorWithSkipOptions
166+
options?: CursorWithSkipOptions,
167167
): Token | null;
168168

169169
getFirstTokensBetween(
170170
left: NodeOrToken,
171171
right: NodeOrToken,
172-
options?: CursorWithCountOptions
172+
options?: CursorWithCountOptions,
173173
): Token[];
174174

175175
getLastTokenBetween(
176176
left: NodeOrToken,
177177
right: NodeOrToken,
178-
options?: CursorWithSkipOptions
178+
options?: CursorWithSkipOptions,
179179
): Token | null;
180180

181181
getLastTokensBetween(
182182
left: NodeOrToken,
183183
right: NodeOrToken,
184-
options?: CursorWithCountOptions
184+
options?: CursorWithCountOptions,
185185
): Token[];
186186

187187
getTokensBetween(
188188
left: NodeOrToken,
189189
right: NodeOrToken,
190-
padding?: number | FilterPredicate | CursorWithCountOptions
190+
padding?: number | FilterPredicate | CursorWithCountOptions,
191191
): Token[];
192192

193193
getTokens(node: Node, beforeCount?: number, afterCount?: number): Token[];
194194
getTokens(
195195
node: Node,
196-
options: FilterPredicate | CursorWithCountOptions
196+
options: FilterPredicate | CursorWithCountOptions,
197197
): Token[];
198198

199199
commentsExistBetween(left: NodeOrToken, right: NodeOrToken): boolean;

0 commit comments

Comments
 (0)