Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions doc/contributors/extensions/gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ import events from './events.json.js';
const mdlib = {};
mdlib.h = (out, n, str) => {
out(`${'#'.repeat(n)} ${str}\n\n`);
}
};

const N_START = 3;

const out = str => process.stdout.write(str);
for ( const event of events ) {
mdlib.h(out, N_START, `\`${event.id}\``);
out(dedent(event.description) + '\n\n');
out(`${dedent(event.description) }\n\n`);

for ( const k in event.properties ) {
const prop = event.properties[k];
mdlib.h(out, N_START + 1, `Property \`${k}\``);
out(prop.summary + '\n');
out(`${prop.summary }\n`);
out(`- **Type**: ${prop.type}\n`);
out(`- **Mutability**: ${prop.mutability}\n`);
if ( prop.notes ) {
out(`- **Notes**:\n`);
out('- **Notes**:\n');
for ( const note of prop.notes ) {
out(` - ${note}\n`);
}
Expand All @@ -29,7 +29,7 @@ for ( const event of events ) {
}

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

Expand Down
12 changes: 6 additions & 6 deletions doc/contributors/extensions/manual_overrides.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ export default [
summary: 'the email being validated',
notes: [
'The email may have already been cleaned.',
]
],
},
allow: {
type: 'boolean',
mutability: 'mutable',
summary: 'whether the email is allowed',
notes: [
'If set to false, the email will be considered invalid.',
]
],
},
},
},
Expand All @@ -44,8 +44,8 @@ export default [
measurements: data.measurements
});
});
`
}
`,
},
},
{
id: 'core.fs.create.directory',
Expand All @@ -61,8 +61,8 @@ export default [
context: {
type: 'Context',
mutability: 'no-effect',
summary: 'current context'
summary: 'current context',
},
}
},
},
];
24 changes: 12 additions & 12 deletions doc/self-hosters/config-vals.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default [
`,
example_values: [
'example.com',
'subdomain.example.com'
]
'subdomain.example.com',
],
},
{
key: 'protocol',
Expand All @@ -18,8 +18,8 @@ export default [
`,
example_values: [
'http',
'https'
]
'https',
],
},
{
key: 'static_hosting_domain',
Expand All @@ -30,7 +30,7 @@ export default [
you could set this to something like
\`site.192.168.555.12.nip.io\`, replacing
\`192.168.555.12\` with a valid IP address belonging to the server.
`
`,
},
{
key: 'allow_all_host_values',
Expand All @@ -44,7 +44,7 @@ export default [
description: `
If true, Puter will allow requests with host headers that end in nip.io.
This is useful for development, LAN, and VPN configurations.
`
`,
},
{
key: 'http_port',
Expand All @@ -57,28 +57,28 @@ export default [
description: `
If true, any /username/Public directory will be available to all
users, including anonymous users.
`
`,
},
{
key: 'disable_temp_users',
description: `
If true, new users will see the login/signup page instead of being
automatically logged in as a temporary user.
`
`,
},
{
key: 'disable_user_signup',
description: `
If true, the signup page will be disabled and the backend will not
accept new user registrations.
`
`,
},
{
key: 'disable_fallback_mechanisms',
description: `
A general setting to prevent any fallback behavior that might
"hide" errors. It is recommended to set this to true when
debugging, testing, or developing new features.
`
}
]
`,
},
];
8 changes: 4 additions & 4 deletions doc/self-hosters/gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import configVals from './config-vals.json.js';
const mdlib = {};
mdlib.h = (out, n, str) => {
out(`${'#'.repeat(n)} ${str}\n\n`);
}
};

const N_START = 3;

const out = str => process.stdout.write(str);
for ( const configVal of configVals ) {
mdlib.h(out, N_START, `\`${configVal.key}\``);
out(dedent(configVal.description) + '\n\n');
out(`${dedent(configVal.description) }\n\n`);

if ( configVal.example_values ) {
mdlib.h(out, N_START + 1, `Examples`);
mdlib.h(out, N_START + 1, 'Examples');
for ( const example of configVal.example_values ) {
out(`- \`"${configVal.key}": ${JSON.stringify(example)}\`\n`);
}
Expand Down
84 changes: 51 additions & 33 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ import spaceUnaryOpsWithException from './eslint/space-unary-ops-with-exception.

const rules = {
'no-unused-vars': ['error', {
'vars': 'all',
'args': 'after-used',
'caughtErrors': 'all',
'ignoreRestSiblings': false,
'ignoreUsingDeclarations': false,
'reportUsedIgnorePattern': false,
'argsIgnorePattern': '^_',
'caughtErrorsIgnorePattern': '^_',
'destructuredArrayIgnorePattern': '^_',
vars: 'all',
args: 'after-used',
caughtErrors: 'none',
ignoreRestSiblings: false,
ignoreUsingDeclarations: false,
reportUsedIgnorePattern: false,
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',

}],
curly: ['error', 'multi-line'],
Expand Down Expand Up @@ -60,7 +59,7 @@ export default defineConfig([
// TypeScript support block
{
files: ['**/*.ts'],
ignores: ['tests/**/*.ts', 'extensions'],
ignores: ['tests/**/*.ts', 'extensions/**/*.ts'],
languageOptions: {
parser: tseslintParser,
parserOptions: {
Expand All @@ -75,7 +74,7 @@ export default defineConfig([
rules: {
// Recommended rules for TypeScript
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', caughtErrors: 'none' }],
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
},
Expand All @@ -88,7 +87,7 @@ export default defineConfig([
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: 'extensions/tsconfig.json',
project: './extensions/tsconfig.json',
},
},
plugins: {
Expand All @@ -97,16 +96,18 @@ export default defineConfig([
rules: {
// Recommended rules for TypeScript
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', caughtErrors: 'none' }],
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
},
},
} },
// TypeScript support for tests
{
files: ['tests/**/*.ts'],
ignores: ['tests/playwright/tests/**/*.ts'],

languageOptions: {
parser: tseslintParser,
globals: { ...globals.jest, ...globals.node },
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
Expand All @@ -119,11 +120,10 @@ export default defineConfig([
rules: {
// Recommended rules for TypeScript
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', caughtErrors: 'none' }],
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
},
},
} },
{
plugins: {
js,
Expand All @@ -136,7 +136,14 @@ export default defineConfig([
},
},
{
files: ['src/backend/**/*.{js,mjs,cjs,ts}'],
files: [
'src/backend/**/*.{js,mjs,cjs,ts}',
'src/backend-core-0/**/*.{js,mjs,cjs,ts}',
'src/putility/**/*.{js,mjs,cjs,ts}',
],
ignores: [
'**/*.test.js',
],
languageOptions: { globals: globals.node },
rules,
extends: ['js/recommended'],
Expand All @@ -145,6 +152,17 @@ export default defineConfig([
'@stylistic': stylistic,
},
},
{
files: [
'**/*.test.js',
],
languageOptions: { globals: { ...globals.jest, ...globals.node } },
rules,
plugins: {
js,
'@stylistic': stylistic,
},
},
{
files: ['extensions/**/*.{js,mjs,cjs,ts}'],
languageOptions: {
Expand All @@ -163,36 +181,36 @@ export default defineConfig([
},
},
{
files: ['**/*.{js,mjs,cjs,ts}'],
files: ['**/*.{js,mjs,cjs,ts}', 'src/gui/src/**/*.js'],
ignores: [
'src/backend/**/*.{js,mjs,cjs,ts}',
'extensions/**/*.{js,mjs,cjs,ts}',
'src/backend-core-0/**/*.{js,mjs,cjs,ts}',
'submodules/**',
'tests/**',
'tools/**',
'**/*.min.js',
'**/*.min.cjs',
'**/*.min.mjs',
'**/socket.io.js',
'**/dist/*.js',
'src/phoenix/test/**',
'src/gui/src/lib/**',
'src/gui/dist/**',
],
languageOptions: {
globals: {
...globals.browser,
...globals.jquery,
i18n: 'readonly',
},
},
rules,
},
{
files: ['**/*.{js,mjs,cjs,ts}'],
ignores: ['src/backend/**/*.{js,mjs,cjs,ts}'],
languageOptions: {
globals: {
...globals.browser,
...globals.jquery,
i18n: 'readonly',
puter: 'readonly',
},
},
rules,
extends: ['js/recommended'],
plugins: {
js,
'@stylistic': stylistic,

},
},
]);
2 changes: 1 addition & 1 deletion eslint/bang-space-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
return {
IfStatement (ifNode) {
const testRaw = ifNode.test;
if ( !testRaw ) return;
if ( ! testRaw ) return;

const test = unwrapParens(testRaw);
if ( !test || test.type !== 'UnaryExpression' || test.operator !== '!' ) {
Expand Down
Loading