ESLintのバージョンを6にあげたらいろいろな箇所でエラーになるように... object.hasOwnProperty(key)で怒られてました。 検索すると説明がありました。 ESLint v6.0.0 の変更点まとめ 「no-prototype-builtins」でひっかかってたんですね。 Examples of incorrect code for this rule: ダメな書き方 判定するときには下のようにしてたんですが、それでもダメなんですかねぇ?
husky v5 で使い方が変わっている(v6 でも変更後の使い方を継続している)。 husky v4 が deprecated した訳ではない (v5.0.0 リリース後にも v4 系のパッチリリースがある)。 The Parity Public License というのを初めて見ましたが、組み込んだソフトウェアも公開しないと行けないっぽい。つまり商用利用、実質不可。 ライブラリ毎の違いを確認する (CLI から) husky v4 (↓) husky v4 をインストールすると、 .git/hooks 配下に git-hooks 用の shell script が追加される。 $ git init husky-v4 $ cd husky-v4 $ npm init $ npm i husky@4 $ ls -1 .git/hooks | grep -v .sample applypat
OSSのnpmパッケージにおいて、第三者によるPRでyarn.lockやpackage-lock.jsonなどのロックファイルに変更が加えられている場合、すべての変更を徹底してチェックしなければならない。 なぜなら、パッケージの参照元となるyarnやnpmのレジストリのURLをしれっと改ざんされてしまうリスクがあるため。 例えば以下の画像のようにyarn.lockに定義されたパッケージのresolvedがhttps://registry.yarnpkg.com/...からhttps://malicious.example/...に書き換えられてしまうかもしれない。 lockfile-lint このリスクを軽減するのにlockfile-lintが便利。 例えば👆のコマンドではyarn.lockの中で npmとyarnのレジストリ以外のURLが参照されていないか すべてhttpsのURLにな
This is a simple linter which is designed to report upon functions which are not implemented in alphabetical order within files. The motivation behind this tool was twofold: I find it easier to navigate functions if they are ordered alphabetically. Most IDEs offer a tree/outline view which is ordered alphabetically, and the contents and the tree should match! Once I realized a linter, driven by "g
What is publint publint lints npm packages to ensure widest compatibility across environments, such as Vite, Webpack, Rollup, Node.js, etc. A full list of lint rules can be found at the rules page. How it works When linting an npm package, the site downloads the tarball from the npm registry, and runs publint against it in a web worker. For larger packages, it may take a while to download and lint
とはいえ, まるっと設定を実施するのでいずれ上記は別の箇所に移動していきます。 ESLint の初期設定 公式の Getting Started を参考に実施していきます。 簡単に eslint --init を使って, 構成ファイル生成とライブラリのインストールをやります。(eslint をグローバルインストールしたくないので, 公式通りに便利な npx で実施していきます) ちなみに, 公式の Getting Started の先頭の npm install eslint --save-dev を飛ばしているのは, eslint --init の最後で npm install に誘導してくれるからです。 ? What type of modules does your project use? … ❯ JavaScript modules (import/export) CommonJ
はじめに PSR-12 とは PSR-2 と PSR-12 の違い PHP_CodeSniffer とは IntelliJ / PHPStorm でスタイルチェックする Jenkins でコーディングスタイルチェック まとめ はじめに この記事は PHP アドベントカレンダー 4日目の記事です。 qiita.com 昨日は @taro-hida さんでした。 qiita.com 僕は新卒から5年間ずっとPHPを触っているので、PHPのアドベントカレンダーにはなるべく参加しようと思っています。 PSR-12 とは PSR-12 とは、 PHP のコーディング規約です。 PHP のコーディング規約には PSR-1 と PSR-12 があり、 PSR-1 は Basic Coding Standard https://www.php-fig.org/psr/psr-1/ PSR-12 は Ext
はじめに Rustコンパイラであるrustcには組込みのlintがあります。 Rustのlintツールでは、clippyが有名ですが、rustc組込みの方もソースコードの改善に役立ちます。 7月の技術書同人誌博覧会のネタ探しの一環だったのですが、思ったより世の中の役に立ちそうだったので、ドラフトを公開します。 原稿落とさなければ、「組込み / ベアメタルRustテクニック集」的な薄い本を出す予定です。 ちなみにここに書いている内容は、全てThe rustc bookに書いてあります。 lint lintはソースコードをコンパイラより厳密なルールに則り、検査するためのツールです。 Rustコンパイラには、様々なlintルールが組み込まれています。 ソースコードをコンパイルする時、自動的にlintによる検査が行われます。 プロジェクトの運用ルールに合わせて、適切なlintルールを設定することで
The tech layoff wave is still going strong in 2024. Following significant workforce reductions in 2022 and 2023, this year has already seen 60,000 job cuts across 254 companies, according to independent layoffs tracker Layoffs.fyi. Companies like Tesla, Amazon, Google, TikTok, Snap and Microsoft have conducted sizable layoffs in the first months of 2024. Smaller-sized…
testdouble/standard: 🌟 Ruby Style Guide, with linter & automatic code fixer Rubyに「ほどよい」Linterを用意したい実はだいぶ前から Ruby に「ほどよい」Linter がないものかと思っていた。Rubocop は避けたかった。設定が面倒だし、よさげな設定を探して歩くのもイヤだ。あと話題になった当初の評判がよくなかったのもある。 JavaScript については Flycheck入れてみた (2019-09-16) | あーありがち の頃だから3年近く前かな、この時期に JavaScript Standard Style にしている。今となってはなんとなく Standard っぽいかどうかを身体が覚えて何も考えずにそんな感じのコードになる。考えることが減ってよいと思っている。 翻って Ruby については
Fixit is dead! Long live Fixit 2 – the latest version of our open-source auto-fixing linter. Fixit 2 allows developers to efficiently build custom lint rules and perform auto-fixes for their codebases. Fixit 2 is available today on PyPI. Python is one of the most popular languages in use at Meta. Meta’s production engineers (PEs) are specialized software engineers (SWEs) who focus on reliability,
Today we’re excited to announce the release of Biome v1.7! This new version provides an easy path to migrate from ESLint and Prettier. It also introduces experimental machine-readable reports for the formatter and the linter, new linter rules, and many fixes. Update Biome using the following commands:
こんにちはhiro08です。 仕事で書くブログでは、ブログ記事を書き終える-> 記事をレビューしてもらう流れがあります。そこでよく指摘されたのが、用語の間違いや表記ゆれです。 実際に私が指摘された例がこちらです。 用語が正確ではない ○ Cloud Functions ☓ cloud functions これは他のブログでもよく見られます。大文字であるべき場所が、小文字になってしまっているケースです。javascriptも正確にはJavaScriptです。 表記ゆれ フォルダ フォルダー 微妙な表記ゆれですが、全体で単語が統一されていないと、違和感のある文章になってしまいます。 以上の2つを指摘されました。私はブログ記事を書き終わった後、2度セルフレビューします。しかし、ブログ記事の文章量が膨大になるほど、チェック漏れが発生していました。人間の目視だけでは限界がありますよね。そこで、日本語
実行 インストールが完了するとvultureコマンドが使えるようになっています。そのコマンドを使って実行します。 全てのオブジェクトが使われている状態 定義されている全てのオブジェクトが使われているサンプルコードを作りました。 # -*- coding: utf-8 -*- USE = 'use' class Use(object): use_attr = 'use' def use(self, value): self.use_attr = value return self.use_attr def use(): Use.use(USE) if __name__ == '__main__': use()
はじめに インデントを揃えただけのムダなコミットが増えてきて、プルリクやコミット履歴に関係ないファイルが多くなり「これはいかん」となったので、FlutterにおけるFormatterやLinterについて調べてみました。 FormatterやLinterを調べてたら、なんとその自動化の方法やちょっとした便利なパッケージを見つけましたのでそちらもご紹介いたします。 この記事で紹介したことを導入すると、「コードの整形や解析が自動で行われ」、「正しい書き方がある程度身につき」、「import 文が見やすく」なります(最後のはおまけ)。 個人的結論 FormatterはDart標準搭載のもので十分 Linterは有名な設定を include した上でプロジェクトに沿った設定をする Lefthookを導入して$ git commit時に自動整形する Linterは制約が強めなpedantic_mon
In the previous article of the "How to Structure a Large Scale Vue Application" series, we took a look at some standards that you can employ in your Vue.js application to keep your codebase predictable, easy to navigate, and understandable. Another step you can take to improve the developer experience when building a large scale application, especially with a team, is to setup some automated proce
stylelint.config.js �� ] V `��\ V module.exports = { plugins: ['stylelint-order', 'stylelint-scss'], rules: { indentation: 2, 'color-hex-case': 'lower', // hex値は小文字指定(大文字を禁止) 'color-hex-length': 'short', // hex値は短い表記(冗長な表記は禁止) 'color-named': 'never', // 名前付きカラー指定を禁止 'color-no-invalid-hex': true, // 無効な16進数の色指定を禁止 'function-comma-space-after': 'always-single-line', // 単一行のカンマ後には空白が必要 'function-comm
こんにちは!DA(データアナリティクス)事業本部 インテグレーション部の大高です。 先日、Angular 11がリリースされました。以前からロードマップに上がっていましたが、Angularブログのリリース紹介記事でもLintingについて記載されています。 In previous versions of Angular, we’ve shipped a default implementation for linting (TSLint). Now, TSLint is deprecated by the project creators who recommend migration to ESLint. (中略) We’re deprecating the use of TSLint and Codelyzer in version 11. This means that in fut
ESLint と Prettier の設定を共通化し、異なるプロジェクトでも同じ設定を使えるようにする(Shareable Configs 機能) 🦥 複数プロジェクト間でコーディング規約を統一するの、マジでオススメです。 はじめにこの記事では、ESLint と Prettier の設定をプロジェクト間で共通化する方法について解説します。共通化するのに必要な知識(ESLint / Prettier で提供されている Sharable Configs 機能、npm パッケージへの公開、各プロジェクトでの読み込み方)をメインに解説していきます。 対象読者は、フロントエンドエンジニアとさせていただき、「ESLint / Prettier とは何か」と言った部分に関しては、この記事では割愛させていただきます。ご了承くださいませ。 背景と課題僕たちの会社 J-CAT も創業して1年が過ぎ、だんだん
今回は、エラー解決にかなり時間を要したので、備忘録として残しておく。 タイトルのとおり、新規プロジェクトを開始する際に、なぜか私の pre-commit が動かないという事態に遭遇した。pre-commit は複数人で開発を行っている際に、とても便利なのでその機能も含め、紹介する。 pre-commit とは husky と lint-staged の設定方法 インストール 設定 husky で設定した pre-commit が動かない問題 そもそも pre-commit が設定されているか確認する Git のバージョンを確認する 参照先が間違っていないか確認する Yarnのバージョンを確認する まとめ pre-commit とは Gitにも、特定のアクションが発生した時にカスタムスクリプトを叩く方法がある。(Gitフックという。)pre-commit もその一つで、コミットの実行前に実行
Overloaded signatures which are not next to each other can lead to code which is hard to read and maintain. Invalid: (bar is declared in-between foo overloads) type FooType = { foo(s: string): void; foo(n: number): void; bar(): void; foo(sn: string | number): void; }; interface FooInterface { foo(s: string): void; foo(n: number): void; bar(): void; foo(sn: string | number): void; } class FooClass
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く