Skip to content

Commit b0ffb31

Browse files
committed
fix: eslint autofixable errors
1 parent f177397 commit b0ffb31

File tree

929 files changed

+56976
-51947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

929 files changed

+56976
-51947
lines changed

doc/contributors/extensions/gen.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ import events from './events.json.js';
44
const mdlib = {};
55
mdlib.h = (out, n, str) => {
66
out(`${'#'.repeat(n)} ${str}\n\n`);
7-
}
7+
};
88

99
const N_START = 3;
1010

1111
const out = str => process.stdout.write(str);
1212
for ( const event of events ) {
1313
mdlib.h(out, N_START, `\`${event.id}\``);
14-
out(dedent(event.description) + '\n\n');
15-
14+
out(`${dedent(event.description) }\n\n`);
15+
1616
for ( const k in event.properties ) {
1717
const prop = event.properties[k];
1818
mdlib.h(out, N_START + 1, `Property \`${k}\``);
19-
out(prop.summary + '\n');
19+
out(`${prop.summary }\n`);
2020
out(`- **Type**: ${prop.type}\n`);
2121
out(`- **Mutability**: ${prop.mutability}\n`);
2222
if ( prop.notes ) {
23-
out(`- **Notes**:\n`);
23+
out('- **Notes**:\n');
2424
for ( const note of prop.notes ) {
2525
out(` - ${note}\n`);
2626
}
@@ -29,7 +29,7 @@ for ( const event of events ) {
2929
}
3030

3131
if ( event.example ) {
32-
mdlib.h(out, N_START + 1, `Example`);
32+
mdlib.h(out, N_START + 1, 'Example');
3333
out(`\`\`\`${event.example.language}\n${dedent(event.example.code)}\n\`\`\`\n`);
3434
}
3535

doc/contributors/extensions/manual_overrides.json.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ export default [
1212
summary: 'the email being validated',
1313
notes: [
1414
'The email may have already been cleaned.',
15-
]
15+
],
1616
},
1717
allow: {
1818
type: 'boolean',
1919
mutability: 'mutable',
2020
summary: 'whether the email is allowed',
2121
notes: [
2222
'If set to false, the email will be considered invalid.',
23-
]
23+
],
2424
},
2525
},
2626
},
@@ -44,8 +44,8 @@ export default [
4444
measurements: data.measurements
4545
});
4646
});
47-
`
48-
}
47+
`,
48+
},
4949
},
5050
{
5151
id: 'core.fs.create.directory',
@@ -61,8 +61,8 @@ export default [
6161
context: {
6262
type: 'Context',
6363
mutability: 'no-effect',
64-
summary: 'current context'
64+
summary: 'current context',
6565
},
66-
}
66+
},
6767
},
6868
];

doc/self-hosters/config-vals.json.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export default [
88
`,
99
example_values: [
1010
'example.com',
11-
'subdomain.example.com'
12-
]
11+
'subdomain.example.com',
12+
],
1313
},
1414
{
1515
key: 'protocol',
@@ -18,8 +18,8 @@ export default [
1818
`,
1919
example_values: [
2020
'http',
21-
'https'
22-
]
21+
'https',
22+
],
2323
},
2424
{
2525
key: 'static_hosting_domain',
@@ -30,7 +30,7 @@ export default [
3030
you could set this to something like
3131
\`site.192.168.555.12.nip.io\`, replacing
3232
\`192.168.555.12\` with a valid IP address belonging to the server.
33-
`
33+
`,
3434
},
3535
{
3636
key: 'allow_all_host_values',
@@ -44,7 +44,7 @@ export default [
4444
description: `
4545
If true, Puter will allow requests with host headers that end in nip.io.
4646
This is useful for development, LAN, and VPN configurations.
47-
`
47+
`,
4848
},
4949
{
5050
key: 'http_port',
@@ -57,28 +57,28 @@ export default [
5757
description: `
5858
If true, any /username/Public directory will be available to all
5959
users, including anonymous users.
60-
`
60+
`,
6161
},
6262
{
6363
key: 'disable_temp_users',
6464
description: `
6565
If true, new users will see the login/signup page instead of being
6666
automatically logged in as a temporary user.
67-
`
67+
`,
6868
},
6969
{
7070
key: 'disable_user_signup',
7171
description: `
7272
If true, the signup page will be disabled and the backend will not
7373
accept new user registrations.
74-
`
74+
`,
7575
},
7676
{
7777
key: 'disable_fallback_mechanisms',
7878
description: `
7979
A general setting to prevent any fallback behavior that might
8080
"hide" errors. It is recommended to set this to true when
8181
debugging, testing, or developing new features.
82-
`
83-
}
84-
]
82+
`,
83+
},
84+
];

doc/self-hosters/gen.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import configVals from './config-vals.json.js';
44
const mdlib = {};
55
mdlib.h = (out, n, str) => {
66
out(`${'#'.repeat(n)} ${str}\n\n`);
7-
}
7+
};
88

99
const N_START = 3;
1010

1111
const out = str => process.stdout.write(str);
1212
for ( const configVal of configVals ) {
1313
mdlib.h(out, N_START, `\`${configVal.key}\``);
14-
out(dedent(configVal.description) + '\n\n');
15-
14+
out(`${dedent(configVal.description) }\n\n`);
15+
1616
if ( configVal.example_values ) {
17-
mdlib.h(out, N_START + 1, `Examples`);
17+
mdlib.h(out, N_START + 1, 'Examples');
1818
for ( const example of configVal.example_values ) {
1919
out(`- \`"${configVal.key}": ${JSON.stringify(example)}\`\n`);
2020
}

eslint.config.js

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ import spaceUnaryOpsWithException from './eslint/space-unary-ops-with-exception.
1010

1111
const rules = {
1212
'no-unused-vars': ['error', {
13-
'vars': 'all',
14-
'args': 'after-used',
15-
'caughtErrors': 'all',
16-
'ignoreRestSiblings': false,
17-
'ignoreUsingDeclarations': false,
18-
'reportUsedIgnorePattern': false,
19-
'argsIgnorePattern': '^_',
20-
'caughtErrorsIgnorePattern': '^_',
21-
'destructuredArrayIgnorePattern': '^_',
13+
vars: 'all',
14+
args: 'after-used',
15+
caughtErrors: 'none',
16+
ignoreRestSiblings: false,
17+
ignoreUsingDeclarations: false,
18+
reportUsedIgnorePattern: false,
19+
argsIgnorePattern: '^_',
20+
destructuredArrayIgnorePattern: '^_',
2221

2322
}],
2423
curly: ['error', 'multi-line'],
@@ -60,7 +59,7 @@ export default defineConfig([
6059
// TypeScript support block
6160
{
6261
files: ['**/*.ts'],
63-
ignores: ['tests/**/*.ts', 'extensions'],
62+
ignores: ['tests/**/*.ts', 'extensions/**/*.ts'],
6463
languageOptions: {
6564
parser: tseslintParser,
6665
parserOptions: {
@@ -75,7 +74,7 @@ export default defineConfig([
7574
rules: {
7675
// Recommended rules for TypeScript
7776
'@typescript-eslint/no-explicit-any': 'warn',
78-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
77+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', caughtErrors: 'none' }],
7978
'@typescript-eslint/ban-ts-comment': 'warn',
8079
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
8180
},
@@ -88,7 +87,7 @@ export default defineConfig([
8887
parserOptions: {
8988
ecmaVersion: 'latest',
9089
sourceType: 'module',
91-
project: 'extensions/tsconfig.json',
90+
project: './extensions/tsconfig.json',
9291
},
9392
},
9493
plugins: {
@@ -97,16 +96,18 @@ export default defineConfig([
9796
rules: {
9897
// Recommended rules for TypeScript
9998
'@typescript-eslint/no-explicit-any': 'warn',
100-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
99+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', caughtErrors: 'none' }],
101100
'@typescript-eslint/ban-ts-comment': 'warn',
102101
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
103-
},
104-
},
102+
} },
105103
// TypeScript support for tests
106104
{
107105
files: ['tests/**/*.ts'],
106+
ignores: ['tests/playwright/tests/**/*.ts'],
107+
108108
languageOptions: {
109109
parser: tseslintParser,
110+
globals: { ...globals.jest, ...globals.node },
110111
parserOptions: {
111112
ecmaVersion: 'latest',
112113
sourceType: 'module',
@@ -119,11 +120,10 @@ export default defineConfig([
119120
rules: {
120121
// Recommended rules for TypeScript
121122
'@typescript-eslint/no-explicit-any': 'warn',
122-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
123+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', caughtErrors: 'none' }],
123124
'@typescript-eslint/ban-ts-comment': 'warn',
124125
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
125-
},
126-
},
126+
} },
127127
{
128128
plugins: {
129129
js,
@@ -136,7 +136,14 @@ export default defineConfig([
136136
},
137137
},
138138
{
139-
files: ['src/backend/**/*.{js,mjs,cjs,ts}'],
139+
files: [
140+
'src/backend/**/*.{js,mjs,cjs,ts}',
141+
'src/backend-core-0/**/*.{js,mjs,cjs,ts}',
142+
'src/putility/**/*.{js,mjs,cjs,ts}',
143+
],
144+
ignores: [
145+
'**/*.test.js',
146+
],
140147
languageOptions: { globals: globals.node },
141148
rules,
142149
extends: ['js/recommended'],
@@ -145,6 +152,17 @@ export default defineConfig([
145152
'@stylistic': stylistic,
146153
},
147154
},
155+
{
156+
files: [
157+
'**/*.test.js',
158+
],
159+
languageOptions: { globals: { ...globals.jest, ...globals.node } },
160+
rules,
161+
plugins: {
162+
js,
163+
'@stylistic': stylistic,
164+
},
165+
},
148166
{
149167
files: ['extensions/**/*.{js,mjs,cjs,ts}'],
150168
languageOptions: {
@@ -163,36 +181,36 @@ export default defineConfig([
163181
},
164182
},
165183
{
166-
files: ['**/*.{js,mjs,cjs,ts}'],
184+
files: ['**/*.{js,mjs,cjs,ts}', 'src/gui/src/**/*.js'],
167185
ignores: [
168186
'src/backend/**/*.{js,mjs,cjs,ts}',
169187
'extensions/**/*.{js,mjs,cjs,ts}',
188+
'src/backend-core-0/**/*.{js,mjs,cjs,ts}',
189+
'submodules/**',
190+
'tests/**',
191+
'tools/**',
192+
'**/*.min.js',
193+
'**/*.min.cjs',
194+
'**/*.min.mjs',
195+
'**/socket.io.js',
196+
'**/dist/*.js',
197+
'src/phoenix/test/**',
198+
'src/gui/src/lib/**',
199+
'src/gui/dist/**',
170200
],
171201
languageOptions: {
172202
globals: {
173203
...globals.browser,
174204
...globals.jquery,
175205
i18n: 'readonly',
176-
},
177-
},
178-
rules,
179-
},
180-
{
181-
files: ['**/*.{js,mjs,cjs,ts}'],
182-
ignores: ['src/backend/**/*.{js,mjs,cjs,ts}'],
183-
languageOptions: {
184-
globals: {
185-
...globals.browser,
186-
...globals.jquery,
187-
i18n: 'readonly',
206+
puter: 'readonly',
188207
},
189208
},
190209
rules,
191210
extends: ['js/recommended'],
192211
plugins: {
193212
js,
194213
'@stylistic': stylistic,
195-
196214
},
197215
},
198216
]);

eslint/bang-space-if.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default {
2929
return {
3030
IfStatement (ifNode) {
3131
const testRaw = ifNode.test;
32-
if ( !testRaw ) return;
32+
if ( ! testRaw ) return;
3333

3434
const test = unwrapParens(testRaw);
3535
if ( !test || test.type !== 'UnaryExpression' || test.operator !== '!' ) {

0 commit comments

Comments
 (0)