Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

BB-61 added eslint plugin #1

Merged
merged 8 commits into from
May 23, 2022
Merged

Conversation

mascardoso
Copy link
Collaborator

@mascardoso mascardoso commented May 19, 2022

The intention is not to change heavily existing code. This is just a migration to a new repo so we are able to push this plugin to npm and clean up both Lokalise main app as well as Louis.

@mascardoso mascardoso assigned ghost , sangdth and kibertoad and unassigned ghost May 19, 2022
README.md Outdated

## Supported Rules

* `@lokalise/package-boundary`: Ensures all the imports and exports happen trough index.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trough -> through


![npm](https://img.shields.io/npm/v/@lokalise/eslint-plugin)
![Downloads total](https://img.shields.io/npm/dt/@lokalise/eslint-plugin)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to give a brief explanation of what those rules cover: are they for FE, BE, do they include anything framework-specific? Are they completely standalone or are derived from other popular ruleset?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @artursvonda (I think he first built this) could help me elaborate further on this over this document -> https://github.com/lokalise/eslint-plugin/blob/d7f8cc3733800ea642a563838c3b529706547e18/docs/rules/package-boundary.md

package.json Outdated
"eslint",
"imports",
"boundaries",
"javascript"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no typescript?

package.json Outdated Show resolved Hide resolved
@kibertoad
Copy link
Collaborator

We could use code of conduct and contribution guides. Examples that we could use as a base:
https://github.com/fastify/fastify/blob/main/CODE_OF_CONDUCT.md
https://github.com/fastify/fastify/blob/main/CONTRIBUTING.md

@mascardoso
Copy link
Collaborator Author

@ki

We could use code of conduct and contribution guides. Examples that we could use as a base: https://github.com/fastify/fastify/blob/main/CODE_OF_CONDUCT.md https://github.com/fastify/fastify/blob/main/CONTRIBUTING.md

Igor I wasn't thinking in adding all of these already but added a couple of simple ones for the moment. Let me know.

Copy link
Contributor

@artursvonda artursvonda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, feel free to adapt or ignore.

utils.js Outdated
import path from 'path';

// warms up the module cache. this import takes a while (>500ms)
import 'babel-eslint';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently updating dependencies and this dependency is deprecated so I replaced it with stable one – @babel/eslint-parser

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 2 to 4
/**
* This is temporary solution to the rule that's being proposed to `eslint-plugin-import`
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They declined so no longer temporary :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted.

@@ -0,0 +1,3 @@
# Package Boundary

Ensures all the imports and exports happen through index and not a different file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ensures all the imports and exports happen through index and not a different file.
Ensures boundaries for modules are enforced. Boundaries are defined by presence of index file in the directory. Anything that can be consumed outside module boundary should be exported from the index file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adjusted.

@mascardoso mascardoso merged commit b3b558b into main May 23, 2022
@artursvonda artursvonda deleted the feature/BB-61-add-eslint-plugin branch September 26, 2022 09:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants