diff options
Diffstat (limited to 'app/assets/javascripts/ide/lib/editorconfig/parser.js')
-rw-r--r-- | app/assets/javascripts/ide/lib/editorconfig/parser.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/app/assets/javascripts/ide/lib/editorconfig/parser.js b/app/assets/javascripts/ide/lib/editorconfig/parser.js index 1597e4a8bfa..2adc643a15b 100644 --- a/app/assets/javascripts/ide/lib/editorconfig/parser.js +++ b/app/assets/javascripts/ide/lib/editorconfig/parser.js @@ -2,7 +2,7 @@ import { parseString } from 'editorconfig/src/lib/ini'; import minimatch from 'minimatch'; import { getPathParents } from '../../utils'; -const dirname = path => path.replace(/\.editorconfig$/, ''); +const dirname = (path) => path.replace(/\.editorconfig$/, ''); function isRootConfig(config) { return config.some(([pattern, rules]) => !pattern && rules?.root === 'true'); @@ -44,11 +44,16 @@ function getRulesWithConfigs(filePath, configFiles = [], rules = {}) { export function getRulesWithTraversal(filePath, getFileContent) { const editorconfigPaths = [ - ...getPathParents(filePath).map(x => `${x}/.editorconfig`), + ...getPathParents(filePath).map((x) => `${x}/.editorconfig`), '.editorconfig', ]; return Promise.all( - editorconfigPaths.map(path => getFileContent(path).then(content => ({ path, content }))), - ).then(results => getRulesWithConfigs(filePath, results.filter(x => x.content))); + editorconfigPaths.map((path) => getFileContent(path).then((content) => ({ path, content }))), + ).then((results) => + getRulesWithConfigs( + filePath, + results.filter((x) => x.content), + ), + ); } |