Skip to content

Commit

Permalink
Update prettier rules
Browse files Browse the repository at this point in the history
- Now runs on json files, ignoring ones with "min" in the name, used for minified scripts that shouldn't be formatted
- Will ignore "min" js files. Not sure if that's ignored by default, but it will definitely be ignored now.
  • Loading branch information
almic committed Mar 30, 2024
1 parent 0914975 commit 0720331
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 125 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.json
*.min.json
*.min.js
*.md
*.html
96 changes: 48 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
{
"name": "musicmixer",
"version": "0.1.0",
"description": "library for mixing sounds and music with the Web Audio API",
"main": "dist/main.js",
"engines": {
"node": "21.1.0"
},
"scripts": {
"build": "npm run format && tsc -b && npm run copyDistToDocs",
"start": "onchange --await-write-finish 1000 \"src/**/*.ts\" \"src/**/*.js\" -- npm run build",
"format": "prettier src/**/*.ts src/**/*.js test/**/*.ts test/**/*.js --write",
"copyDistToDocs": "xcopy .\\dist\\*.js .\\docs\\js\\lib /e /y /v /i /f",
"test": "node test/build/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/almic/MusicMixer.git"
},
"keywords": [
"music",
"mixing"
],
"author": "almic",
"license": "MIT",
"bugs": {
"url": "https://github.com/almic/MusicMixer/issues"
},
"homepage": "https://github.com/almic/MusicMixer#readme",
"devDependencies": {
"@types/node": "21.1.0",
"@types/semver": "6.2.0",
"nwjs-types": "^1.0.0",
"onchange": "^7.1.0",
"prettier": "1.19.1",
"semver": "6.3.1",
"typescript": "4.1.6"
},
"prettier": {
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "crlf",
"printWidth": 110,
"singleQuote": true,
"semi": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": false
}
"name": "musicmixer",
"version": "0.1.0",
"description": "library for mixing sounds and music with the Web Audio API",
"main": "dist/main.js",
"engines": {
"node": "21.1.0"
},
"scripts": {
"build": "npm run format && tsc -b && npm run copyDistToDocs",
"start": "onchange --await-write-finish 1000 \"src/**/*.ts\" \"src/**/*.js\" -- npm run build",
"format": "prettier src/**/*.ts src/**/*.js test/**/*.ts test/**/*.js --write",
"copyDistToDocs": "xcopy .\\dist\\*.js .\\docs\\js\\lib /e /y /v /i /f",
"test": "node test/build/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/almic/MusicMixer.git"
},
"keywords": [
"music",
"mixing"
],
"author": "almic",
"license": "MIT",
"bugs": {
"url": "https://github.com/almic/MusicMixer/issues"
},
"homepage": "https://github.com/almic/MusicMixer#readme",
"devDependencies": {
"@types/node": "21.1.0",
"@types/semver": "6.2.0",
"nwjs-types": "^1.0.0",
"onchange": "^7.1.0",
"prettier": "1.19.1",
"semver": "6.3.1",
"typescript": "4.1.6"
},
"prettier": {
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "crlf",
"printWidth": 110,
"singleQuote": true,
"semi": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": false
}
}
57 changes: 26 additions & 31 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
{
"files": [
"AudioSourceNode.ts",
"MusicMixer.ts",
"Track.ts",
"defaults.ts",
],
"compilerOptions": {
"composite": true,
"files": ["AudioSourceNode.ts", "MusicMixer.ts", "Track.ts", "defaults.ts"],
"compilerOptions": {
"composite": true,

"target": "ES2017",

"module": "CommonJS",
"target": "ES2017",

"allowJs": true,
"checkJs": true,
"maxNodeModuleJsDepth": 0,
"module": "CommonJS",

"declaration": true,
"inlineSourceMap": true,
"outDir": "../dist",
"removeComments": true,
"allowJs": true,
"checkJs": true,
"maxNodeModuleJsDepth": 0,

"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"declaration": true,
"inlineSourceMap": true,
"outDir": "../dist",
"removeComments": true,

"strict": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,

"skipLibCheck": true
}
"strict": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,

"skipLibCheck": true
}
}
42 changes: 21 additions & 21 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"compilerOptions": {
"composite": true,
"compilerOptions": {
"composite": true,

"target": "ES2017",
"target": "ES2017",

"module": "ESNext",
"module": "ESNext",

"allowJs": true,
"checkJs": true,
"maxNodeModuleJsDepth": 0,
"allowJs": true,
"checkJs": true,
"maxNodeModuleJsDepth": 0,

"outDir": "./build",
"outDir": "./build",

"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,

"strict": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"strict": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,

"skipLibCheck": true
}
"skipLibCheck": true
}
}
45 changes: 21 additions & 24 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
{
"references": [
{ "path": "./src/" },
{ "path": "./test/" }
],
"files": [],
"compilerOptions": {
"target": "ES2017",
"references": [{ "path": "./src/" }, { "path": "./test/" }],
"files": [],
"compilerOptions": {
"target": "ES2017",

"allowJs": true,
"checkJs": true,
"maxNodeModuleJsDepth": 0,
"allowJs": true,
"checkJs": true,
"maxNodeModuleJsDepth": 0,

"noEmit": true,
"noEmit": true,

"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,

"strict": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"strict": true,
"alwaysStrict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,

"skipLibCheck": true
}
"skipLibCheck": true
}
}

0 comments on commit 0720331

Please sign in to comment.