Skip to content

Commit

Permalink
prettier rc
Browse files Browse the repository at this point in the history
  • Loading branch information
byeongsu-hong committed Mar 7, 2024
1 parent 0f9161c commit 278c942
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 30 deletions.
36 changes: 15 additions & 21 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
module.exports = {
root: true,
// eslint에 어떠한 parser를 사용할지 알려주는 옵션
// eslint가 typescript 문법을 이해할 수 있게 해준다.
parser: '@typescript-eslint/parser',
// typescript-eslint에서 제공하는 규칙들을 사용할 수 있게 해준다.
plugins: ['@typescript-eslint'],
// 어떠한 규칙들과 설정으로 eslint를 사용할지 명시한다.
// 아래와 같이 작성하면 default 값으로 적용이 된다.
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],

rules: {
// 세미콜론이 없으면 에러로 취급한다.
semi: 'error',
// 기존 프로젝트에서는 'warn'으로 취급되지만, 'error'로 설정하면 에러로 취급한다.
'@typescript-eslint/no-unused-vars': 'error'
}
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
'prettier/prettier': [
'error',
{
usePrettierrc: true,
},
],
};
File renamed without changes.
18 changes: 9 additions & 9 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as fs from "fs";
import codegen from "@cosmwasm/ts-codegen";
import path from "path";
import codegen from '@cosmwasm/ts-codegen';
import * as fs from 'fs';
import path from 'path';

const SCHEMA_DIR = process.env.SCHEMA_DIR || path.join(process.cwd(), "schema");
const SCHEMA_DIR = process.env.SCHEMA_DIR || path.join(process.cwd(), 'schema');

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const capitalize = (str: string): string =>
Expand All @@ -12,19 +12,19 @@ const contracts = fs
.readdirSync(SCHEMA_DIR, { withFileTypes: true })
.filter((c) => !c.isDirectory())
.map((c) => ({
name: c.name.replace(".json", ""),
name: c.name.replace('.json', ''),
dir: SCHEMA_DIR,
}));

codegen({
contracts,
outPath: "./dist/",
outPath: './dist/',

// options are completely optional ;)
options: {
bundle: {
bundleFile: "index.ts",
scope: "contracts",
bundleFile: 'index.ts',
scope: 'contracts',
},
client: {
enabled: true,
Expand All @@ -34,5 +34,5 @@ codegen({
},
},
}).then(() => {
console.log("✨ all done!");
console.log('✨ all done!');
});

0 comments on commit 278c942

Please sign in to comment.