-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds pre-commit hooks via update project
- Loading branch information
1 parent
605b4cd
commit 2ff1908
Showing
12 changed files
with
130 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
repos: | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
args: [--quiet] | ||
exclude: node_modules | ||
|
||
- repo: local | ||
hooks: | ||
- id: prettier | ||
name: prettier | ||
entry: npm run prettier:fix | ||
language: system | ||
files: arches_lingo/src | ||
- id: eslint | ||
name: eslint | ||
entry: npm run eslint:fix | ||
language: system | ||
files: arches_lingo/src | ||
- id: typescript | ||
name: typescript | ||
entry: npm run ts:check | ||
language: system | ||
types: [ | ||
"ts", | ||
"vue", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"singleAttributePerLine": true | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* eslint-disable */ | ||
|
||
const Path = require('path'); | ||
const fs = require('fs'); | ||
|
||
function buildFilepathLookup(path, staticUrlPrefix) { | ||
if (!fs.existsSync(path)) { | ||
return; | ||
} | ||
|
||
const prefix = path.match(/[^/]+$/); | ||
const staticUrl = staticUrlPrefix ? staticUrlPrefix : ""; | ||
|
||
const getFileList = function (dirPath) { | ||
return fs.readdirSync(dirPath, { withFileTypes: true }).reduce((fileList,entries) => { | ||
const childPath = Path.join(dirPath, entries.name); | ||
|
||
if (entries.isDirectory()) { | ||
fileList.push(...getFileList(childPath, fileList)); | ||
} else | ||
{ | ||
fileList.push(childPath); | ||
} | ||
return fileList; | ||
}, []); | ||
}; | ||
|
||
return getFileList(path).reduce((lookup, file) => { | ||
const extension = file.match(/[^.]+$/).toString(); | ||
const extensionReplacementRegex = new RegExp(`\\.${extension}$`); | ||
|
||
if (extension === 'js') { | ||
lookup[file.replace(path,'').replace(/\\/g, '/').replace(extensionReplacementRegex,'').replace(/^\//,'')] = {"import": file, "filename": `${prefix}/[name].${extension}`}; | ||
} | ||
else if (extension === 'css' || extension === 'scss') { | ||
lookup[Path.join('css', file.replace(path,'').replace(/\\/g, '/')).replace(extensionReplacementRegex,'').replace(/^\//,'')] = { 'import': file }; | ||
} | ||
else { | ||
// staticUrl used for images | ||
lookup[`${staticUrl}${prefix}/${file.replace(path,'').replace(/\\/g, '/').replace(/^\//,'')}`] = file; | ||
} | ||
return lookup; | ||
}, {}); | ||
} | ||
|
||
module.exports = { buildFilepathLookup }; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.