@jcoreio/toolchain 5.2.0 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/eslintConfig.cjs CHANGED
@@ -1,8 +1,3 @@
1
1
  const getPluginsArraySync = require('./util/getPluginsArraySync.cjs')
2
2
 
3
- module.exports = {
4
- extends: [
5
- ...getPluginsArraySync('getEslintExtends'),
6
- require.resolve('eslint-config-prettier'),
7
- ],
8
- }
3
+ module.exports = [...getPluginsArraySync('getEslintConfigs')]
@@ -3,16 +3,16 @@ const getPluginsArraySync = require('./util/getPluginsArraySync.cjs')
3
3
  const lintExtList = getPluginsArraySync('lintExtensions')
4
4
 
5
5
  const lintExts =
6
- lintExtList.length === 1
7
- ? `*.${lintExtList[0]}`
8
- : `*.{${lintExtList.join(',')}}`
6
+ lintExtList.length === 1 ?
7
+ `*.${lintExtList[0]}`
8
+ : `*.{${lintExtList.join(',')}}`
9
9
 
10
10
  const formatExtList = getPluginsArraySync('formatExtensions')
11
11
 
12
12
  const formatExts =
13
- formatExtList.length === 1
14
- ? `*.${formatExtList[0]}`
15
- : `*.{${formatExtList.join(',')}}`
13
+ formatExtList.length === 1 ?
14
+ `*.${formatExtList[0]}`
15
+ : `*.{${formatExtList.join(',')}}`
16
16
 
17
17
  module.exports = {
18
18
  [lintExts]: ['tc lint:fix'],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain",
3
- "version": "5.2.0",
3
+ "version": "5.3.1",
4
4
  "description": "base JS build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,6 +14,12 @@
14
14
  },
15
15
  "homepage": "https://github.com/jcoreio/toolchains/tree/main/packages/base",
16
16
  "dependencies": {
17
+ "@babel/generator": "^7.27.0",
18
+ "@babel/parser": "^7.27.0",
19
+ "@babel/template": "^7.27.0",
20
+ "@babel/types": "^7.27.0",
21
+ "@eslint/compat": "^1.2.8",
22
+ "@eslint/js": "^9.23.0",
17
23
  "@jcoreio/eslint-plugin-implicit-dependencies": "^1.1.1",
18
24
  "chalk": "^4.0.0",
19
25
  "dedent-js": "^1.0.1",
@@ -23,6 +29,7 @@
23
29
  "find-up": "^5.0.0",
24
30
  "fs-extra": "^10.0.0",
25
31
  "glob": "^11.0.0",
32
+ "globals": "^16.0.0",
26
33
  "js-yaml": "4.1.0",
27
34
  "json5": "^2.2.1",
28
35
  "lint-staged": "^15.2.2",
@@ -43,13 +50,12 @@
43
50
  "packageManager": "pnpm@10.6.5",
44
51
  "devDependencies": {
45
52
  "eslint": "*",
46
- "@jcoreio/eslint-plugin-implicit-dependencies": "*"
53
+ "globals": "*",
54
+ "lint-staged": "*",
55
+ "prettier": "*"
47
56
  }
48
57
  },
49
58
  "bin": {
50
- "eslint": "./bin/eslint",
51
- "lint-staged": "./bin/lint-staged",
52
- "prettier": "./bin/prettier",
53
59
  "tc": "./scripts/toolchain.cjs",
54
60
  "toolchain": "./scripts/toolchain.cjs"
55
61
  },
@@ -1,54 +1,46 @@
1
1
  const { name } = require('../package.json')
2
2
  const dedent = require('dedent-js')
3
3
  const fs = require('../util/projectFs.cjs')
4
- const JSON5 = require('json5')
5
4
  const { isMonorepoSubpackage } = require('../util/findUps.cjs')
6
5
  const getPluginsArraySync = require('../util/getPluginsArraySync.cjs')
7
6
  const initBuildIgnore = require('../util/initBuildIgnore.cjs')
8
-
9
- async function getRootEslintConfig() {
10
- if (await fs.pathExists('.eslintrc.json')) {
11
- return JSON5.parse(await fs.readFile('.eslintrc.json', 'utf8'))
12
- }
13
- if (await fs.pathExists('.eslintrc')) {
14
- return JSON5.parse(await fs.readFile('.eslintrc', 'utf8'))
15
- }
16
- }
7
+ const migrateLegacyEslintConfigs = require('../util/migrateLegacyEslintConfigs.cjs')
8
+ const chalk = require('chalk')
9
+ const { glob } = require('../util/glob.cjs')
17
10
 
18
11
  module.exports = [
19
12
  async function getConfigFiles({ fromVersion }) {
20
- const { env, rules } = (await getRootEslintConfig()) || {}
21
13
  const files = {
22
- ...(isMonorepoSubpackage
23
- ? {}
24
- : {
25
- '.npmrc': dedent`
14
+ ...(isMonorepoSubpackage ?
15
+ {}
16
+ : {
17
+ '.npmrc': dedent`
26
18
  optional=false
27
19
  `,
28
- }),
29
- '.eslintrc.cjs': async (existing) =>
30
- existing && fromVersion
31
- ? existing
32
- : dedent`
33
- /* eslint-env node, es2018 */
34
- module.exports = {
35
- extends: [require.resolve('${name}/eslintConfig.cjs')],${
36
- env
37
- ? `\nenv: ${JSON.stringify(env, null, 2).replace(
38
- /\n/gm,
39
- '\n '
40
- )},`
41
- : ''
42
- }${
43
- rules
44
- ? `\nrules: ${JSON.stringify(rules, null, 2).replace(
45
- /\n/gm,
46
- '\n '
47
- )}`
48
- : ''
20
+ }),
21
+ 'eslint.config.cjs': async (existing) => {
22
+ if (existing && fromVersion) return existing
23
+ const configs = {}
24
+ for (const file of await glob('**/.eslintrc{,.json,.js,.cjs}')) {
25
+ configs[file] = await fs.readFile(file)
26
+ }
27
+ const { migrated, warnings } = await migrateLegacyEslintConfigs(configs)
28
+ if (warnings.length) {
29
+ for (const [file, fileWarnings] of Object.entries(warnings)) {
30
+ // eslint-disable-next-line no-console
31
+ console.warn(
32
+ chalk.yellow(
33
+ dedent`
34
+ WARNING: ${file} could not be completely migrated because of the following:
35
+ ${fileWarnings.map((w) => `- ${w}`).join('\n ')}
36
+
37
+ `
38
+ )
39
+ )
49
40
  }
50
41
  }
51
- `,
42
+ return migrated
43
+ },
52
44
  'toolchain.config.cjs': async (existing) => {
53
45
  if (existing) return existing
54
46
  return dedent`
@@ -72,9 +64,8 @@ module.exports = [
72
64
  'prettier.config.cjs',
73
65
  ]) {
74
66
  files[file] = async (existing) =>
75
- existing && fromVersion
76
- ? existing
77
- : dedent`
67
+ existing && fromVersion ? existing : (
68
+ dedent`
78
69
  /* eslint-env node, es2018 */
79
70
  const base = require('${name}/${file}')
80
71
  module.exports = {
@@ -82,39 +73,38 @@ module.exports = [
82
73
  }
83
74
 
84
75
  `
76
+ )
85
77
  }
86
- const tasks = isMonorepoSubpackage
87
- ? []
88
- : await getPluginsArraySync('vscodeTasks')
89
- const launch = isMonorepoSubpackage
90
- ? []
91
- : await getPluginsArraySync('vscodeLaunch')
78
+ const tasks =
79
+ isMonorepoSubpackage ? [] : await getPluginsArraySync('vscodeTasks')
80
+ const launch =
81
+ isMonorepoSubpackage ? [] : await getPluginsArraySync('vscodeLaunch')
92
82
 
93
83
  if (tasks.length) {
94
84
  files['.vscode/tasks.json'] = async (existing) =>
95
- existing && fromVersion
96
- ? existing
97
- : JSON.stringify(
98
- {
99
- version: '2.0.0',
100
- tasks,
101
- },
102
- null,
103
- 2
104
- )
85
+ existing && fromVersion ? existing : (
86
+ JSON.stringify(
87
+ {
88
+ version: '2.0.0',
89
+ tasks,
90
+ },
91
+ null,
92
+ 2
93
+ )
94
+ )
105
95
  }
106
96
  if (launch.length) {
107
97
  files['.vscode/launch.json'] = async (existing) =>
108
- existing && fromVersion
109
- ? existing
110
- : JSON.stringify(
111
- {
112
- version: '0.2.0',
113
- configurations: launch,
114
- },
115
- null,
116
- 2
117
- )
98
+ existing && fromVersion ? existing : (
99
+ JSON.stringify(
100
+ {
101
+ version: '0.2.0',
102
+ configurations: launch,
103
+ },
104
+ null,
105
+ 2
106
+ )
107
+ )
118
108
  }
119
109
 
120
110
  return files
@@ -0,0 +1,105 @@
1
+ const js = require('@eslint/js')
2
+ const { defineConfig } = require('eslint/config')
3
+ const { includeIgnoreFile } = require('@eslint/compat')
4
+ const { projectDir } = require('../util/findUps.cjs')
5
+ const path = require('path')
6
+ const fs = require('../util/projectFs.cjs')
7
+ const { globSync } = require('../util/glob.cjs')
8
+
9
+ module.exports = [
10
+ () => {
11
+ const gitignores = globSync('**/.gitignore')
12
+ if (fs.pathExistsSync('.eslintignore')) {
13
+ gitignores.push('.eslintignore')
14
+ }
15
+ return defineConfig([
16
+ ...gitignores.map((file) =>
17
+ includeIgnoreFile(path.resolve(projectDir, file))
18
+ ),
19
+ js.configs.recommended,
20
+ {
21
+ files: ['**/*.{js,cjs,mjs}'],
22
+ plugins: {
23
+ '@jcoreio/implicit-dependencies': require('@jcoreio/eslint-plugin-implicit-dependencies'),
24
+ },
25
+ rules: {
26
+ '@jcoreio/implicit-dependencies/no-implicit': [
27
+ 'error',
28
+ {
29
+ dev: true,
30
+ peer: true,
31
+ optional: true,
32
+ },
33
+ ],
34
+ 'arrow-spacing': 'error',
35
+ 'comma-spacing': 'error',
36
+ 'computed-property-spacing': ['error', 'never'],
37
+ 'eol-last': 'error',
38
+ 'jsx-quotes': 'error',
39
+ 'keyword-spacing': 'error',
40
+ 'key-spacing': [
41
+ 'error',
42
+ {
43
+ mode: 'strict',
44
+ },
45
+ ],
46
+ 'linebreak-style': 'error',
47
+ 'no-console': 'error',
48
+ 'no-unused-vars': [
49
+ 'error',
50
+ {
51
+ args: 'none',
52
+ varsIgnorePattern: 'React',
53
+ },
54
+ ],
55
+ 'no-extra-semi': 'error',
56
+ 'no-multi-spaces': 'error',
57
+ 'no-multiple-empty-lines': 'error',
58
+ 'no-trailing-spaces': 'error',
59
+ 'no-unexpected-multiline': 'error',
60
+ 'no-unreachable': 'error',
61
+ 'no-whitespace-before-property': 'error',
62
+ 'object-shorthand': ['error', 'always'],
63
+ 'padded-blocks': ['error', 'never'],
64
+ semi: ['error', 'never'],
65
+ 'space-before-blocks': ['error', 'always'],
66
+ 'space-before-function-paren': [
67
+ 'error',
68
+ {
69
+ anonymous: 'always',
70
+ named: 'never',
71
+ },
72
+ ],
73
+ 'space-in-parens': ['error', 'never'],
74
+ 'space-infix-ops': ['error', { int32Hint: false }],
75
+ 'space-unary-ops': [
76
+ 'error',
77
+ {
78
+ words: true,
79
+ nonwords: false,
80
+ },
81
+ ],
82
+ 'rest-spread-spacing': ['error', 'never'],
83
+ },
84
+ },
85
+ {
86
+ files: ['src/**'],
87
+ ignores: ['**/__tests__/**'],
88
+ plugins: {
89
+ '@jcoreio/implicit-dependencies': require('@jcoreio/eslint-plugin-implicit-dependencies'),
90
+ },
91
+ rules: {
92
+ '@jcoreio/implicit-dependencies/no-implicit': [
93
+ 'error',
94
+ {
95
+ dev: false,
96
+ peer: true,
97
+ optional: true,
98
+ },
99
+ ],
100
+ },
101
+ },
102
+ require('eslint-config-prettier'),
103
+ ])
104
+ },
105
+ ]
@@ -4,5 +4,6 @@ module.exports = {
4
4
  semi: false,
5
5
  singleQuote: true,
6
6
  trailingComma: 'es5',
7
+ experimentalTernaries: true,
7
8
  overrides: getPluginsArraySync('prettierOverrides'),
8
9
  }
@@ -73,27 +73,27 @@ async function create(args = []) {
73
73
  message: 'Package keywords:',
74
74
  format: (text) => (text || '').split(/\s*,\s*|\s+/g),
75
75
  },
76
- ...(monorepoPackageJson
77
- ? []
78
- : [
79
- {
80
- type: 'text',
81
- name: 'organization',
82
- initial: (prev, { name }) => {
83
- const match = /^@(.*?)\//.exec(name)
84
- if (match) return match[1]
85
- },
86
- message: 'GitHub organization:',
87
- validate: required,
76
+ ...(monorepoPackageJson ?
77
+ []
78
+ : [
79
+ {
80
+ type: 'text',
81
+ name: 'organization',
82
+ initial: (prev, { name }) => {
83
+ const match = /^@(.*?)\//.exec(name)
84
+ if (match) return match[1]
88
85
  },
89
- {
90
- type: 'text',
91
- name: 'repo',
92
- message: 'GitHub repo:',
93
- initial: (prev, { name }) => name.replace(/^@(.*?)\//, ''),
94
- validate: required,
95
- },
96
- ]),
86
+ message: 'GitHub organization:',
87
+ validate: required,
88
+ },
89
+ {
90
+ type: 'text',
91
+ name: 'repo',
92
+ message: 'GitHub repo:',
93
+ initial: (prev, { name }) => name.replace(/^@(.*?)\//, ''),
94
+ validate: required,
95
+ },
96
+ ]),
97
97
  {
98
98
  type: 'select',
99
99
  name: 'license',
@@ -140,8 +140,9 @@ async function create(args = []) {
140
140
  copyrightHolder,
141
141
  } = answers
142
142
 
143
- const { organization, repo } = monorepoPackageJson
144
- ? parseRepositoryUrl(monorepoPackageJson.repository.url)
143
+ const { organization, repo } =
144
+ monorepoPackageJson ?
145
+ parseRepositoryUrl(monorepoPackageJson.repository.url)
145
146
  : answers
146
147
 
147
148
  const cwd = path.resolve(directory)
@@ -150,12 +151,12 @@ async function create(args = []) {
150
151
 
151
152
  const fs = ChdirFs(cwd)
152
153
 
153
- const subpackagePath = monorepoProjectDir
154
- ? path.relative(monorepoProjectDir, cwd)
155
- : undefined
154
+ const subpackagePath =
155
+ monorepoProjectDir ? path.relative(monorepoProjectDir, cwd) : undefined
156
156
 
157
- const branch = subpackagePath
158
- ? (
157
+ const branch =
158
+ subpackagePath ?
159
+ (
159
160
  await execa('git', ['rev-parse', '--abbrev-ref', 'HEAD'], {
160
161
  stdio: 'pipe',
161
162
  encoding: 'utf8',
package/scripts/init.cjs CHANGED
@@ -73,11 +73,9 @@ async function init(args = []) {
73
73
  '--prefer-offline',
74
74
  ...(isMonorepoRoot ? ['-w'] : []),
75
75
  isTest ? '../packages/base' : `${name}@^${version}`,
76
- ...(isTest
77
- ? [...selectedToolchains].map((t) =>
78
- t.replace(`${name}-`, '../packages/')
79
- )
80
- : [...selectedToolchains].map((t) => `${t}@^${version}`)),
76
+ ...(isTest ?
77
+ [...selectedToolchains].map((t) => t.replace(`${name}-`, '../packages/'))
78
+ : [...selectedToolchains].map((t) => `${t}@^${version}`)),
81
79
  ])
82
80
  await execa('tc', ['migrate'])
83
81
  if (isInteractive) {
@@ -1,26 +1,12 @@
1
1
  const { glob } = require('../../util/glob.cjs')
2
2
  const Path = require('path')
3
- const JSON5 = require('json5')
4
3
  const fs = require('../../util/projectFs.cjs')
5
4
 
6
5
  async function migrateEslintConfigs({ fromVersion }) {
7
- if (fromVersion) {
8
- // only do this migration on init
9
- return
10
- }
11
- for (const file of await glob(Path.join('**', '.eslintrc{,.json}'))) {
12
- const content = JSON5.parse(await fs.readFile(file, 'utf8'))
13
- if (content.extends) {
14
- delete content.extends
15
- await fs.writeFile(file, JSON5.stringify(content, null, 2), 'utf8')
16
- }
17
- }
18
6
  for (const file of [
7
+ ...(await glob(Path.join('**', '.eslintrc{,.json}'))),
19
8
  '.eslintrc.js',
20
- '.eslintrc.json',
21
- '.eslintrc.yaml',
22
- '.eslintrc.yml',
23
- '.eslintrc',
9
+ '.eslintrc.cjs',
24
10
  ]) {
25
11
  const exists = await fs.pathExists(file)
26
12
  if (exists) {
@@ -110,53 +110,55 @@ async function migrateProjectPackageJson({ fromVersion }) {
110
110
  packageJson.exports = {
111
111
  './package.json': './package.json',
112
112
  '.': {
113
- ...(packageJson.types
114
- ? { types: relativize(packageJson.types) }
115
- : {}),
116
- ...(outputEsm !== false && packageJson.module
117
- ? { import: relativize(packageJson.module) }
118
- : {}),
113
+ ...(packageJson.types ?
114
+ { types: relativize(packageJson.types) }
115
+ : {}),
116
+ ...(outputEsm !== false && packageJson.module ?
117
+ { import: relativize(packageJson.module) }
118
+ : {}),
119
119
  default: relativize(packageJson.main),
120
120
  },
121
- ...(dotStar
122
- ? {
123
- './*': {
124
- types: './*.d.ts',
125
- ...(outputEsm !== false ? { import: './*.mjs' } : {}),
126
- default: './*.js',
127
- },
128
- }
129
- : {}),
121
+ ...(dotStar ?
122
+ {
123
+ './*': {
124
+ types: './*.d.ts',
125
+ ...(outputEsm !== false ? { import: './*.mjs' } : {}),
126
+ default: './*.js',
127
+ },
128
+ }
129
+ : {}),
130
130
  }
131
131
  }
132
132
  }
133
133
 
134
134
  merge(
135
135
  packageJson,
136
- fromVersion
137
- ? {}
138
- : {
139
- version: '0.0.0-development',
140
- sideEffects: false,
141
- scripts: {
142
- tc: 'toolchain',
143
- toolchain: 'toolchain',
144
- test: 'toolchain test',
145
- prepublishOnly:
146
- 'echo This package is meant to be published by semantic-release from the dist build directory. && exit 1',
147
- },
136
+ fromVersion ?
137
+ {}
138
+ : {
139
+ version: '0.0.0-development',
140
+ sideEffects: false,
141
+ scripts: {
142
+ tc: 'toolchain',
143
+ toolchain: 'toolchain',
144
+ test: 'toolchain test',
145
+ prepublishOnly:
146
+ 'echo This package is meant to be published by semantic-release from the dist build directory. && exit 1',
148
147
  },
148
+ },
149
149
  pick(toolchainManaged, 'engines', 'packageManager'),
150
150
  {
151
151
  packageManager:
152
- !packageJson.packageManager ||
153
- !packageJson.packageManager.startsWith('pnpm@') ||
154
- semver.lt(
155
- packageJson.packageManager.replace(/^pnpm@/, ''),
156
- toolchainManaged.packageManager.replace(/^pnpm@/, '')
157
- )
158
- ? toolchainManaged.packageManager
159
- : packageJson.packageManager,
152
+ (
153
+ !packageJson.packageManager ||
154
+ !packageJson.packageManager.startsWith('pnpm@') ||
155
+ semver.lt(
156
+ packageJson.packageManager.replace(/^pnpm@/, ''),
157
+ toolchainManaged.packageManager.replace(/^pnpm@/, '')
158
+ )
159
+ ) ?
160
+ toolchainManaged.packageManager
161
+ : packageJson.packageManager,
160
162
  },
161
163
  pick(packageJson, 'engines')
162
164
  )
@@ -1,6 +1,7 @@
1
1
  module.exports = [
2
2
  '@babel/cli',
3
3
  '@babel/core',
4
+ '@babel/eslint-parser',
4
5
  '@babel/plugin-dynamic-import-node',
5
6
  '@babel/plugin-external-helpers',
6
7
  '@babel/plugin-proposal-class-properties',
@@ -41,6 +42,7 @@ module.exports = [
41
42
  '@commitlint/cli',
42
43
  '@commitlint/config-conventional',
43
44
  '@jcoreio/commitlint-config',
45
+ '@jcoreio/eslint-plugin-implicit-dependencies',
44
46
  '@jedwards1211/commitlint-config',
45
47
  '@jedwards1211/eslint-config-flow',
46
48
  '@jedwards1211/eslint-config-react',
@@ -52,6 +54,7 @@ module.exports = [
52
54
  '@semantic-release/release-notes-generator',
53
55
  '@typescript-eslint/eslint-plugin',
54
56
  '@typescript-eslint/parser',
57
+ '@typescript-eslint/typescript-estree',
55
58
  'babel-cli',
56
59
  'babel-core',
57
60
  'babel-eslint',
@@ -97,6 +100,10 @@ module.exports = [
97
100
  'cz-conventional-changelog',
98
101
  'coveralls',
99
102
  'eslint-watch',
103
+ 'eslint-plugin-flowtype',
104
+ 'eslint-plugin-ft-flow',
105
+ 'eslint-plugin-no-only-tests',
106
+ 'eslint-plugin-react',
100
107
  'flow-copy-source',
101
108
  'flow-watch',
102
109
  'husky',
@@ -20,9 +20,8 @@ async function migrate(args = []) {
20
20
  const hasYarnOrNpmLockfile = require('../util/hasYarnOrNpmLockfile.cjs')
21
21
  const writeMigratedVersion = require('../util/writeMigratedVersion.cjs')
22
22
 
23
- const fromVersion = packageJson[name]
24
- ? packageJson[name].migratedVersion
25
- : undefined
23
+ const fromVersion =
24
+ packageJson[name] ? packageJson[name].migratedVersion : undefined
26
25
  if (!fromVersion && !isMonorepoSubpackage && !findGitDir()) {
27
26
  await execa('git', ['init'])
28
27
  await installGitHooks.run()
@@ -1,33 +1,7 @@
1
- const fs = require('../util/projectFs.cjs')
2
1
  const execa = require('../util/execa.cjs')
3
- const getPluginsArraySync = require('../util/getPluginsArraySync.cjs')
4
-
5
- async function eslintArgs() {
6
- return [
7
- ...((await fs.pathExists('.eslintignore')) ||
8
- !(await fs.pathExists('.gitignore'))
9
- ? []
10
- : (await fs.readFile('.gitignore', 'utf8'))
11
- .split(/\r\n?|\n/gm)
12
- .flatMap((pattern) =>
13
- !/^#/.test(pattern.trim())
14
- ? ['--ignore-pattern', pattern.trim()]
15
- : []
16
- )),
17
- '--ignore-pattern',
18
- 'flow-typed/',
19
- '--ext',
20
- getPluginsArraySync('lintExtensions').join(','),
21
- ]
22
- }
23
2
 
24
3
  async function runEslint(args = []) {
25
- await execa('eslint', [...args, ...(await eslintArgs())], {
26
- env: {
27
- ...process.env,
28
- ESLINT_USE_FLAT_CONFIG: 'false',
29
- },
30
- })
4
+ await execa('eslint', [...args])
31
5
  }
32
6
  exports.runEslint = runEslint
33
7
 
@@ -2,11 +2,12 @@ const fs = require('../util/projectFs.cjs')
2
2
  const execa = require('../util/execa.cjs')
3
3
 
4
4
  async function prettierArgs() {
5
- return (await fs.pathExists('.prettierignore'))
6
- ? ['--ignore-path', '.prettierignore']
7
- : (await fs.pathExists('.gitignore'))
8
- ? ['--ignore-path', '.gitignore']
9
- : []
5
+ return (
6
+ (await fs.pathExists('.prettierignore')) ?
7
+ ['--ignore-path', '.prettierignore']
8
+ : (await fs.pathExists('.gitignore')) ? ['--ignore-path', '.gitignore']
9
+ : []
10
+ )
10
11
  }
11
12
 
12
13
  async function runPrettier(args = []) {