これはメモです

それ以上でもそれ以下でもないのです

2022-06-01から1ヶ月間の記事一覧

npmでモジュールをdevDependenciesからdependenciesに変更する

npm

インストールし直す方法しか知らず面倒だったので調べました。 devDependenciesからdependenciesに npm i <module_name> -P npm i <module_name> --save-prod 「productに使用するのでP」と考えると覚えやすい。 dependenciesからdevDependenciesに npm i <module_name> -D npm i <module_name> --save-dev 環境構</module_name></module_name></module_name></module_name>…

ESLint Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. エラー

ViteでTypeScript + React + ESlint(airbnb) の環境構築をしている際に遭遇したエラー。 環境 M1 mac Monterey 12.4 node v16.13.0 npm 8.1.0 VSCode エラー内容 .eslintrc.jsおよびvite.config.tsで下記エラーが出る。 Parsing error: "parserOptions.proje…

ESLint Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. エラー

ViteでTypeScript + React + ESlint(airbnb) の環境構築をしている際に遭遇したエラー。 環境 M1 mac Monterey 12.4 node v16.13.0 npm 8.1.0 VSCode エラー内容 .eslintrc.jsおよびvite.config.tsで下記エラーが出る。 Parsing error: "parserOptions.proje…

ESLintの"JSX not allowed in files with extension '.tsx'"エラー

拡張子が'.tsx'のファイルではJSXは許可されないというエラー。 github.com .eslintrc*ファイル内のrulesに拡張子を追加することで解消できる。 rules: { + 'react/jsx-filename-extension': [ + 'error', + { extensions: ['.js', '.jsx', 'ts', 'tsx'] }, …

フロントエンドツールの公式サイトリンク集

公式を見ながらひとつひとつ設定していくのが最も理解が深まると思うのでメモ。 Vite ja.vitejs.dev ESLint eslint.org React フック用プラグイン https://ja.reactjs.org/docs/hooks-rules.html#eslint-plugin 'React' must be in scope when using JSX エ…