This repository is a collection of eslint configs for use in Seam projects. Centralizing eslint configs enables uniform styles across Seam projects, and to avoid bike-shedding within a particular project.
Feel free to use these for personal use.
In your .eslintrc and .eslintrc.js file, add the following lines:
module.exports = {
extends: ['./node_modules/@seamapi/eslint-configs/std1'],
}There are both components and standards in this repository. A standard is intended to be foundational for a project, while components are optionally added. Standards are not expected to dramatically change over time. Instead of retrofitting a standard you should advocate for a new standard then advocate for deprecation of the old standard.
Every standard and component should have a version number.
For use in server-side code, especially API code.
- Optimizes for variable transparency between database, API, and application code
snake_casevariables and data structures
For use in React code.
- Conventional React code style
camelCasefor variables and functions- Common react code protections
Components are configs that can be used to construct new standards or to
For use in API/Server code.
snake_casevariables and data structurescamelCasefunctions
Forces rules from API Design RFC
Note, this may be replaced with schemalint
Enforces schema design best practices.
snake_casecolumns and tablesjsonbobjects have adomainto give them types- Enforces a DAG from the
$mainschema to all other schemas (other schemas cannot reference each other, or the$mainschema, the$mainschema has should have references to other schemas) - No polymorphic associations (uuid column without reference)
- Foreign keys should always be or end in
<referenced_table>_id - All tables have a
created_atcolumn - Tables always have primary keys with column name
<table>_id - No cascading deletes
- No soft delete columns (
is_deleted,deleted_at)
You are welcome to introduce unofficial configs, which will encourage adoption as a standard config. For an unofficial config to become official, it should be used in at least 2 projects and have the approvals of several developers.
(none yet)