Skip to content

Instantly share code, notes, and snippets.

@rafaelrozon
Last active February 21, 2024 03:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelrozon/9fd6bc9efbce3e70311b364f87b89241 to your computer and use it in GitHub Desktop.
Save rafaelrozon/9fd6bc9efbce3e70311b364f87b89241 to your computer and use it in GitHub Desktop.

Naming conventions

What Format Example
Component MyComponentName Button, LoginModal
Action Type [VERB]_[NOUN] TOGGLE_TODO
Action Creator [verb][Noun] toggleTodo
Reducer set[PathToStateKey] setTodosFilter
Selector get/is[PathToStateKey] getTodosById, isTodoCompleted
Story [Feature]Stories TodoStories
Constants [NOUN]_[NOUN] DEFAULT_STATE
Screen Component [ScreenName]Screen LoginScreen
CSS classes kebab case button, date-picker

Filenames

What Format Example
Page Component <MyPage>.jsx Home.jsx
Component <MyComponent>.jsx DatePicker.jsx
Reducer <Feature>Reducer.js LoginReducer.js
Selectors <Feature>Selectors.js LoginSelectors.js
Actions <Feature>Actions.js LoginActions.js
Action Types <Feature>Types.js LoginTypes.js
Storybook <Feature>.story.js Login.story.js
Test <Feature>.test.js Login.test.js
Constants <Feature>Constants.js LoginConstants.js
Locales [language]_[terrytory].json pt_br.json, en_ca.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment