Separate script for linting.

This commit is contained in:
kovacsv 2021-12-23 21:46:52 +01:00
parent 3b68f6d746
commit 43917f401d
3 changed files with 5 additions and 22 deletions

View File

@ -20,11 +20,12 @@
"scripts": { "scripts": {
"start": "http-server", "start": "http-server",
"test": "mocha test", "test": "mocha test",
"build": "node tools/run_python.js tools/build.py", "lint": "eslint source && eslint website",
"doc": "jsdoc -c tools/jsdoc.json",
"build": "npm run lint && npm run doc && node tools/run_python.js tools/build.py",
"update": "node tools/run_python.js tools/update.py", "update": "node tools/run_python.js tools/update.py",
"updatelibs": "npm install && node tools/run_python.js tools/updatelibs.py", "updatelibs": "npm install && node tools/run_python.js tools/updatelibs.py",
"svg": "node tools/run_python.js tools/svg.py", "svg": "node tools/run_python.js tools/svg.py"
"doc": "jsdoc -c tools/jsdoc.json"
}, },
"dependencies": { "dependencies": {
"@simonwep/pickr": "1.8.2", "@simonwep/pickr": "1.8.2",

View File

@ -18,12 +18,6 @@ def GetVersion (rootDir):
packageJson = json.load (packageJsonFile) packageJson = json.load (packageJsonFile)
return packageJson['version'] return packageJson['version']
def ESLintFolder (folder):
result = Tools.RunCommand ('eslint', [folder])
if result != 0:
return False
return True
def CompressCssFiles (inputFiles, outputFile): def CompressCssFiles (inputFiles, outputFile):
parameters = ['-o', outputFile] parameters = ['-o', outputFile]
for inputFile in inputFiles: for inputFile in inputFiles:
@ -143,18 +137,6 @@ def Main (argv):
with open (os.path.join (toolsDir, 'config.json')) as configJson: with open (os.path.join (toolsDir, 'config.json')) as configJson:
config = json.load (configJson) config = json.load (configJson)
PrintInfo ('ESLint importer sources.')
esLintResult = ESLintFolder (os.path.join (rootDir, 'source'))
if not esLintResult:
PrintError ('ESLint importer sources failed.')
return 1
PrintInfo ('ESLint website sources.')
esLintResult = ESLintFolder (os.path.join (rootDir, 'website', 'o3dv'))
if not esLintResult:
PrintError ('ESLint website sources failed.')
return 1
version = GetVersion (rootDir) version = GetVersion (rootDir)
PrintInfo ('Create build directory') PrintInfo ('Create build directory')
CreateDestinationDir (config, rootDir, websiteDir, version, testBuild) CreateDestinationDir (config, rootDir, websiteDir, version, testBuild)

View File

@ -7,7 +7,7 @@
"encoding": "utf8", "encoding": "utf8",
"destination": "build/docs/", "destination": "build/docs/",
"recurse": true, "recurse": true,
"verbose": true "verbose": false
}, },
"docdash" : { "docdash" : {
"menu": { "menu": {