Skip to content

Commit

Permalink
Applied ESLint code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaid committed Oct 3, 2024
1 parent 47df9a9 commit 2558c6b
Show file tree
Hide file tree
Showing 10 changed files with 534 additions and 534 deletions.
10 changes: 5 additions & 5 deletions src/ignores.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const ignores = [
`/dist/`,
`/out/`,
`/temp/`,
`/cache/`,
`/node_modules/`,
'/dist/',
'/out/',
'/temp/',
'/cache/',
'/node_modules/',
]

export const extendIgnores = (...additionalIgnores: Array<string>) => {
Expand Down
14 changes: 7 additions & 7 deletions src/segments/json/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ const config: Linter.FlatConfig = {
// @ts-expect-error TS2322
json: jsonPlugin,
},
ignores: extendIgnores(`package-lock.json`, `package.json`),
files: [`**/*.json`],
ignores: extendIgnores('package-lock.json', 'package.json'),
files: ['**/*.json'],
languageOptions: {
parser,
parserOptions: {
jsonSyntax: `JSON`,
jsonSyntax: 'JSON',
},
},
name: `eslint-config-jaid/json`,
name: 'eslint-config-jaid/json',
rules: {
"json/auto": `warn`,
"json/no-plus-sign": `warn`,
"json/valid-json-number": `error`,
'json/auto': 'warn',
'json/no-plus-sign': 'warn',
'json/valid-json-number': 'error',
},
}

Expand Down
4 changes: 2 additions & 2 deletions src/segments/json/json5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const config: Linter.FlatConfig = {
json: jsonPlugin,
},
ignores,
files: [`**/*.json5`],
files: ['**/*.json5'],
languageOptions: {
parser,
},
name: `eslint-config-jaid/json5`,
name: 'eslint-config-jaid/json5',
rules: jsoncConfig.rules,
}

Expand Down
6 changes: 3 additions & 3 deletions src/segments/json/jsonc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ const config: Linter.FlatConfig = {
json: jsonPlugin,
},
ignores,
files: [`**/*.jsonc`],
files: ['**/*.jsonc'],
languageOptions: {
parser,
parserOptions: {
jsonSyntax: `JSONC`,
jsonSyntax: 'JSONC',
},
},
name: `eslint-config-jaid/jsonc`,
name: 'eslint-config-jaid/jsonc',
rules: jsonConfig.rules,
}

Expand Down
106 changes: 53 additions & 53 deletions src/segments/json/packageJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,87 +12,87 @@ const config: Linter.FlatConfig = {
json: jsonPlugin,
},
ignores,
files: [`**/package.json`],
files: ['**/package.json'],
languageOptions: {
parser,
parserOptions: {
jsonSyntax: `JSON`,
jsonSyntax: 'JSON',
},
},
name: `eslint-config-jaid/packageJson`,
name: 'eslint-config-jaid/packageJson',
rules: {
...jsonConfig.rules,
"json/sort-keys": [
`warn`,
'json/sort-keys': [
'warn',
{
pathPattern: `^$`,
pathPattern: '^$',
order: [
`name`,
`displayName`,
`version`,
`type`,
`private`,
`description`,
`keywords`,
`author`,
`publisher`,
`homepage`,
`bugs`,
`funding`,
`sponsor`,
`license`,
`repository`,
`main`,
`exports`,
`bin`,
`extensionKind`,
`capabilities`,
`activationEvents`,
`contributes`,
`preview`,
`extensionPack`,
`pricing`,
`categories`,
`icon`,
`galleryBanner`,
`markdown`,
`scripts`,
`wireit`,
`dependencies`,
`peerDependencies`,
`peerDependenciesMeta`,
`optionalDependencies`,
`bundledDependencies`,
`devDependencies`,
'name',
'displayName',
'version',
'type',
'private',
'description',
'keywords',
'author',
'publisher',
'homepage',
'bugs',
'funding',
'sponsor',
'license',
'repository',
'main',
'exports',
'bin',
'extensionKind',
'capabilities',
'activationEvents',
'contributes',
'preview',
'extensionPack',
'pricing',
'categories',
'icon',
'galleryBanner',
'markdown',
'scripts',
'wireit',
'dependencies',
'peerDependencies',
'peerDependenciesMeta',
'optionalDependencies',
'bundledDependencies',
'devDependencies',
{
order: {
type: `asc`,
type: 'asc',
natural: true,
},
},
`os`,
`cpu`,
`engines`,
'os',
'cpu',
'engines',
],
},
{
pathPattern: `^dependencies|peerDependencies|optionalDependencies|bundledDependencies|devDependencies|peerDependenciesMeta$`,
pathPattern: '^dependencies|peerDependencies|optionalDependencies|bundledDependencies|devDependencies|peerDependenciesMeta$',
order: {
type: `asc`,
type: 'asc',
natural: true,
},
},
{
pathPattern: `^scripts|wireit$`,
pathPattern: '^scripts|wireit$',
order: {
type: `asc`,
type: 'asc',
natural: true,
},
},
{
pathPattern: `^engines$`,
pathPattern: '^engines$',
order: {
type: `asc`,
type: 'asc',
natural: true,
},
},
Expand Down
Loading

0 comments on commit 2558c6b

Please sign in to comment.