Skip to content
Closed
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

12 changes: 0 additions & 12 deletions .eslintrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from 'eslint-config-salesforce-typescript';
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.3.31",
"@salesforce/cli-plugins-testkit": "^5.3.64",
"@salesforce/dev-scripts": "^11.0.4",
"@salesforce/dev-scripts": "^13.0.2",
"@salesforce/plugin-command-reference": "^3.1.131",
"@salesforce/types": "^1.7.1",
"@types/chai": "^4.3.17",
"@types/mocha": "^10.0.10",
"@types/node": "^18",
"@types/sinon": "^10.0.20",
"eslint": "^10.4.0",
"eslint-config-salesforce-typescript": "^6.0.0",
"eslint-plugin-sf-plugin": "^1.20.33",
"oclif": "^4.23.29",
"ts-node": "^10.9.2",
Expand Down Expand Up @@ -131,6 +137,7 @@
"src/**/*.ts",
"test/**/*.ts",
"messages/**",
"**/eslint.config.*",
"**/.eslint*",
"**/tsconfig.json"
],
Expand Down
3 changes: 1 addition & 2 deletions src/commands/schema/generate/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import type { AnyJson } from '@salesforce/ts-types';
import type { CustomField } from '@salesforce/types/metadata';
import { convertJsonToXml } from '../../../shared/convert.js';
import { picklistPrompts } from '../../../shared/prompts/picklist.js';
Expand Down Expand Up @@ -176,7 +175,7 @@
},
path: path.join(object, 'fields', `${fullName}.field-meta.xml`),
};
this.styledJSON(result as AnyJson);
this.styledJSON(result);
await fs.promises.mkdir(path.join(object, 'fields'), { recursive: true });
await fs.promises.writeFile(result.path, convertJsonToXml({ json: result.field, type: 'CustomField' }));

Expand Down Expand Up @@ -207,7 +206,7 @@
// checkbox type requires a default value
const defaultValuePrompt = async (type: string): Promise<string | undefined> =>
type === 'Checkbox'
? select({

Check failure on line 209 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

This expression is not callable.

Check failure on line 209 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.18.0)

This expression is not callable.
message: messages.getMessage('prompts.defaultValue'),
choices: [{ value: 'false' }, { value: 'true' }],
default: 'false',
Expand All @@ -217,7 +216,7 @@
const startingNumberPrompt = async (type: string): Promise<number | undefined> =>
type === 'AutoNumber'
? Number(
await input({

Check failure on line 219 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

This expression is not callable.

Check failure on line 219 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.18.0)

This expression is not callable.
message: messages.getMessage('prompts.startingNumber'),
default: '0',
validate: integerValidation({ min: 0, max: Number.MAX_SAFE_INTEGER }),
Expand All @@ -226,7 +225,7 @@
: undefined;

const securityPrompt = async (): Promise<string> =>
select({

Check failure on line 228 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

This expression is not callable.

Check failure on line 228 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.18.0)

This expression is not callable.
message: messages.getMessage('prompts.securityClassification'),
choices: ['Public', 'Internal', 'Confidential', 'Restricted', 'Mission Critical'].map(toSelectOption),
default: 'Internal',
Expand All @@ -234,7 +233,7 @@

const externalIdPrompt = async (type: string, object: string): Promise<boolean | undefined> =>
(type === 'Number' || type === 'Text') && !object.endsWith('__e')
? confirm({

Check failure on line 236 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

This expression is not callable.

Check failure on line 236 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.18.0)

This expression is not callable.
message: messages.getMessage('prompts.externalId'),
default: false,
})
Expand All @@ -242,7 +241,7 @@

const uniquePrompt = async (type: string): Promise<boolean | undefined> =>
type === 'Number' || type === 'Text'
? confirm({

Check failure on line 244 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

This expression is not callable.

Check failure on line 244 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.18.0)

This expression is not callable.
message: 'Unique',
default: false,
})
Expand All @@ -251,7 +250,7 @@
const requiredPrompt = async (type: string): Promise<boolean | undefined> =>
['Checkbox', 'MasterDetail', 'Lookup', 'LongTextArea'].includes(type)
? undefined
: confirm({

Check failure on line 253 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

This expression is not callable.

Check failure on line 253 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.18.0)

This expression is not callable.
message: messages.getMessage('prompts.required'),
default: false,
});
Expand All @@ -259,6 +258,6 @@
const inlineHelpPrompt = async (object: string): Promise<string | undefined> =>
object.includes('__e')
? undefined
: input({

Check failure on line 261 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (22)

This expression is not callable.

Check failure on line 261 in src/commands/schema/generate/field.ts

View workflow job for this annotation

GitHub Actions / linux-unit-tests / linux-unit-tests (24.18.0)

This expression is not callable.
message: messages.getMessage('prompts.inlineHelpText'),
});
3 changes: 1 addition & 2 deletions src/commands/schema/generate/platformevent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { dirname } from 'node:path';
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core/messages';
import select from '@inquirer/select';
import type { AnyJson } from '@salesforce/ts-types';
import { apiNamePrompt } from '../../../shared/prompts/apiName.js';
import { pluralPrompt } from '../../../shared/prompts/plural.js';
import { directoryPrompt } from '../../../shared/prompts/directory.js';
Expand Down Expand Up @@ -70,7 +69,7 @@ export default class PlatformEventGenerate extends SfCommand<PlatformEventGenera
label: flags.label,
};

this.styledJSON(objectToWrite as AnyJson);
this.styledJSON(objectToWrite);
const writePath = await writeObjectFile(directory, objectToWrite);
this.info(messages.getMessage('success.field', [dirname(writePath)]));

Expand Down
25 changes: 0 additions & 25 deletions test/.eslintrc.cjs

This file was deleted.

3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "@salesforce/dev-config/tsconfig-strict-esm",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
"rootDir": "src",
"skipLibCheck": true
},
"include": [
"./src/**/*.ts"
Expand Down
Loading
Loading