Skip to content

Commit

Permalink
Updated prettier
Browse files Browse the repository at this point in the history
Fixed format not applying to entire directory
  • Loading branch information
james-pre committed Mar 23, 2024
1 parent c05ec33 commit 22ff6d7
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 32 deletions.
10 changes: 3 additions & 7 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"preset": "ts-jest/presets/default-esm",
"testEnvironment": "node",
"extensionsToTreatAsEsm": [
".ts"
],
"testMatch": [
"./**/*.test.ts"
],
"extensionsToTreatAsEsm": [".ts"],
"testMatch": ["./**/*.test.ts"],
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
Expand All @@ -20,4 +16,4 @@
]
},
"verbose": true
}
}
2 changes: 1 addition & 1 deletion license.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
}
},
"scripts": {
"format": "prettier --write src",
"format:check": "prettier --check src",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "tsc -p tsconfig.json --noEmit && eslint src",
"build": "node scripts/build.mjs",
"build:docs": "typedoc --out docs --name 'ZenFS DOM' src/index.ts",
Expand All @@ -46,7 +46,7 @@
"@typescript-eslint/parser": "^5.55.0",
"esbuild": "^0.17.18",
"eslint": "^8.36.0",
"prettier": "^2.8.7",
"prettier": "^3.2.5",
"typedoc": "^0.25.1",
"typescript": "5.2.2"
},
Expand Down
31 changes: 18 additions & 13 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,27 @@ const ctx = await context({
bundle: true,
minify: true,
platform: 'browser',
plugins: [{ name: 'watcher', setup(build) {
build.onStart(() => {
if(!options.keep) {
rmSync('dist', { force: true, recursive: true });
}
plugins: [
{
name: 'watcher',
setup(build) {
build.onStart(() => {
if (!options.keep) {
rmSync('dist', { force: true, recursive: true });
}

try {
execSync('npx tsc -p tsconfig.json', { stdio: 'inherit' });
} catch (e) {
console.error('status' in e ? e.toString() : e);
}
});
} }],
try {
execSync('npx tsc -p tsconfig.json', { stdio: 'inherit' });
} catch (e) {
console.error('status' in e ? e.toString() : e);
}
});
},
},
],
});

if(options.watch) {
if (options.watch) {
console.log('Watching for changes...');
await ctx.watch();
} else {
Expand Down
10 changes: 8 additions & 2 deletions src/IndexedDB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ function convertError(e: { name: string }, message: string = e.toString()): ApiE
* @hidden
*/
export class IndexedDBROTransaction implements AsyncROTransaction {
constructor(public tx: IDBTransaction, public store: IDBObjectStore) {}
constructor(
public tx: IDBTransaction,
public store: IDBObjectStore
) {}

public get(key: Ino): Promise<Uint8Array> {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -129,7 +132,10 @@ export class IndexedDBStore implements AsyncStore {
});
}

constructor(protected db: IDBDatabase, protected storeName: string) {}
constructor(
protected db: IDBDatabase,
protected storeName: string
) {}

public get name(): string {
return IndexedDB.name + ':' + this.storeName;
Expand Down

0 comments on commit 22ff6d7

Please sign in to comment.