Page MenuHomePhabricator

Add an ESLint rule that check filename format
ClosedPublic

Authored by tomek on Feb 16 2024, 1:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 25, 8:08 PM
Unknown Object (File)
Thu, Jun 20, 1:18 AM
Unknown Object (File)
Sat, Jun 15, 6:57 PM
Unknown Object (File)
Tue, Jun 11, 5:49 PM
Unknown Object (File)
Tue, Jun 11, 10:06 AM
Unknown Object (File)
Tue, Jun 11, 10:06 AM
Unknown Object (File)
Tue, Jun 11, 10:06 AM
Unknown Object (File)
Tue, Jun 11, 10:06 AM
Subscribers

Details

Summary

Add a rule that enforces kebab-case names. Renamed the files using IDE so that all the references were updated.

The rule is from https://github.com/sindresorhus/eslint-plugin-unicorn/tree/main library - MIT license, 3.8k stars on GitHub.

https://linear.app/comm/issue/ENG-6819/make-sure-js-file-names-are-consistent

Test Plan

ESLint, Flow. Also checked if the web app can run.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

.eslintrc.json
73 ↗(On Diff #37295)

We're ignoring two patterns:

  1. The files with flow-typed definitions. These are suffixed with a version pattern which we check here.
  2. CodeGen schemas - updating these would result in different JSI class names.
lib/components/connected-wallet-info.react.js
8 ↗(On Diff #37295)

Decided to go with this instead of sw-mansion... because we already have swmansion-icon-config.json file.

Add missing package.json and lock changes

tomek requested review of this revision.Feb 16 2024, 2:12 AM

Thank you for not just fixing the issue with the recent diff, but all of the issues in the codebase! This ESLint plugin looks great

This revision is now accepted and ready to land.Feb 16 2024, 7:29 AM