# eslint-config-convention-fdel68

> Filesystem and Naming conventions for exports, variables, components name, required files and folders to follow the correct format for Package structure.

Latest version **6.0.2** (published 2022-07-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install eslint-config-convention-fdel68
pnpm add eslint-config-convention-fdel68
yarn add eslint-config-convention-fdel68
bun add eslint-config-convention-fdel68
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.0.2 |
| Published | 2022-07-25 |
| First published | 2022-07-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 21.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | laugsg |
| Keywords | javascript, filesystem, folder, structure, validation, eslint |

## Links

- npm: https://www.npmjs.com/package/eslint-config-convention-fdel68
- npm.io page: https://npm.io/package/eslint-config-convention-fdel68

## Dependencies (5)

- [typescript-eslint](https://npm.io/package/typescript-eslint.md) 0.0.1-alpha.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.30.1
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.26.0
- [eslint-plugin-filenames-simple](https://npm.io/package/eslint-plugin-filenames-simple.md) ^0.7.0
- [eslint-plugin-filename-consistency](https://npm.io/package/eslint-plugin-filename-consistency.md) ^1.0.2

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 6.0.2 (latest) — 2022-07-25
- 6.0.1 — 2022-07-25
- 6.0.0 — 2022-07-25
- 5.2.0 — 2022-07-22
- 5.1.1 — 2022-07-22
- 5.0.1 — 2022-07-22
- 5.0.0 — 2022-07-22
- 4.0.2 — 2022-07-19
- 4.0.1 — 2022-07-19
- 4.0.0 — 2022-07-19
- 3.0.0 — 2022-07-19
- 2.0.1 — 2022-07-19
- 2.0.0 — 2022-07-19
- 1.0.6 — 2022-07-15
- 1.0.5 — 2022-07-15
- … 5 more at https://npm.io/package/eslint-config-convention-fdel68/versions

## README

# Design System Standards for Components

Filesystem and Naming conventions for exports, variables, components name, required files and folders to follow the correct format for Package structure.

Convention stablished in [FDEL68](https://cuponation.atlassian.net/jira/software/c/projects/FDEL/boards/322?modal=detail&selectedIssue=FDEL-68&assignee=6175c9a72097220071fda78e): Create Linting for package filesystem structure and naming convention.

## Installation

The package is intalled as usual, it's required to move configuration files into `config/` folder to the root of the project. A yarn/npx command which executes lint-staged with this configuration files is also required (preferred from `.husky/pre-commit`) as `yarn lint-staged --config convention-FDEL68...` (one for each configuration).

## Naming

It requires two extra files that should be at the project root `convention-FDEL68-naming.config.js` and `convention-FDEL68.naming-rules.config.json`.

convention-FDEL68-naming.config.js will receive just the commited files, then will filter them removing markdown files and json files to lint just component related ones.

convention-FDEL68.naming-rules.config.json will provide the convention-FDEL68-naming.config.js for file rules. It's just a custom configuration file which implements the convention package.

## Run at pre-commit only

Currently, to acheive the whole convention topics, the configuration is splitted in two files which requires specific implementation:

As first step, install the convention as a NPM Package `yarn add --dev eslint-config-convention-FDEL68 -W`

### Config

1. project root : drop the files `convention-FDEL68-naming.config.js` and `convention-FDEL68.naming-rules.config.json`
2. .husky/pre-commit : include in lint-staged command `yarn lint-staged --config convention-FDEL68-naming.config.js`

## Acceptance Criteria

* [x] Naming 
    1. folder/filenames
          1. should be kebab-case
    2. types/Components
          1. should be PascalCase
    3. default export
          1. should be named export





## File System Structure

It requires one extra files that should be at the project root `convention-FDEL68-filesystem.config.js`.

convention-FDEL68-filesystem.config.js will receive a list of commited files as an array of strings, then it will validate the component package folders structure (based in acceptance criteria) and it will check for required files.

1. .husky/pre-commit : include in lint-staged command `yarn lint-staged --config convention-FDEL68-filesystem.config.js`


## File System Structure Scheme

* Query : Top Level
    1. packages/component-name
* Query : Root level (Component)
    1. ../files-in-root
    2. ../src/
* Query : Src level
    1. ../component-files
    2. ../utils/
* Misc : Src level

## Acceptance Criteria

* File system
    * [x] component-name/ : Component level
        1. should have a README
        2. should have a stories
        3. should have a chromatic.stories

  * Misc : 
      1. [x] all sub-components should live inside src/components folder
      2. [x] all utilities should live inside src/utils folder
      3. [x] unexpected folder name under /src (allowed only /components and /utils
      4. [x] should have a index file inside each folder

## theorical assumptions about sub-component folder

A Compoenent package has the following structure:

* Component folder (as root)
    * src folder (component files)
        * utils (inside src folder)
    * finally, files related to configs and testing

Because of this structure, where src/ and dist/ folders are the only folders in the component package, we could assume that _"any other folder would be a sub-component"_. Then it is possible to _invalidate_ the presence of any other folder than src.

---
_Source: https://npm.io/package/eslint-config-convention-fdel68 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
