Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

chore(eslint): add lint rule to disable access modifiers #1458

Merged
merged 6 commits into from
Jun 6, 2019

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Jun 5, 2019

Related to #936.

This PR adds a new rule that disallows to use access modifiers (private, public, protected) for .tsx files.

It also adds a new package @stardust-ui/eslint-plugin because it's required by ESLint, i.e. you can't simply place a file with rules somewhere, only in the package that has correct naming:
https://eslint.org/docs/developer-guide/working-with-plugins

…ore/add-modifiers-lint

# Conflicts:
#	docs/src/components/ExternalExampleLayout.tsx
#	packages/react/src/components/Attachment/Attachment.tsx
#	packages/react/src/components/Chat/Chat.tsx
#	packages/react/src/components/Chat/ChatMessage.tsx
#	packages/react/src/components/List/ListItem.tsx
#	packages/react/src/components/Menu/MenuItem.tsx
#	packages/react/src/components/Popup/Popup.tsx
#	packages/react/src/components/Portal/Portal.tsx
#	packages/react/src/components/RadioGroup/RadioGroup.tsx
#	packages/react/src/components/Tree/TreeTitle.tsx
@DustyTheBot
Copy link
Collaborator

Warnings
⚠️ There are no updates provided to CHANGELOG. Ensure there are no publicly visible changes introduced by this PR.
⚠️ New package.json added: packages/eslint-plugin/package.json. Make sure you have approval before merging!
⚠️ Package (or peer) dependencies changed. Make sure you have approval before merging!

Changed dependencies in packages/internal-tooling/package.json

package before after
@typescript-eslint/eslint-plugin ^1.6.0 ^1.9.0
@typescript-eslint/parser ^1.6.0 ^1.9.0
@stardust-ui/eslint-plugin - ^0.31.0

Generated by 🚫 dangerJS

@codecov
Copy link

codecov bot commented Jun 5, 2019

Codecov Report

Merging #1458 into master will not change coverage.
The diff coverage is 82.06%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1458   +/-   ##
=======================================
  Coverage   73.14%   73.14%           
=======================================
  Files         805      805           
  Lines        6073     6073           
  Branches     1794     1794           
=======================================
  Hits         4442     4442           
  Misses       1625     1625           
  Partials        6        6
Impacted Files Coverage Δ
packages/react/src/components/List/ListItem.tsx 100% <ø> (ø) ⬆️
packages/react/src/components/Popup/Popup.tsx 67.74% <ø> (ø) ⬆️
...es/react/src/components/Reaction/ReactionGroup.tsx 100% <ø> (ø) ⬆️
...ckages/react/src/components/Button/ButtonGroup.tsx 94.11% <ø> (ø) ⬆️
packages/react/src/components/Tree/TreeItem.tsx 6.66% <ø> (ø) ⬆️
packages/react/src/components/Chat/ChatMessage.tsx 84.61% <ø> (ø) ⬆️
packages/react/src/components/Chat/Chat.tsx 62.5% <ø> (ø) ⬆️
packages/react/src/components/Tree/TreeTitle.tsx 10% <ø> (ø) ⬆️
packages/react/src/components/Tree/Tree.tsx 55.17% <ø> (ø) ⬆️
packages/react/src/components/Flex/Flex.tsx 100% <ø> (ø) ⬆️
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f91573e...e7def51. Read the comment docs.

*/
function checkMethodAccessibilityModifier(methodDefinition) {
let nodeType = 'method definition'
switch (methodDefinition.kind) {
Copy link
Member

Choose a reason for hiding this comment

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

if (['get', 'set'].includes(methodDefinition.kind)

@layershifter layershifter merged commit d16891c into master Jun 6, 2019
@delete-merged-branch delete-merged-branch bot deleted the chore/add-modifiers-lint branch June 6, 2019 08:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants