Skip to content

Commit

Permalink
chore: new eslint flat config (#101)
Browse files Browse the repository at this point in the history
* chore: new eslint flat config

* chore: update node version on lint action
  • Loading branch information
alvarosabu authored May 8, 2024
1 parent d9df268 commit 89f6be8
Show file tree
Hide file tree
Showing 36 changed files with 673 additions and 562 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
blank_issues_enabled: false
blank_issues_enabled: false
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "New feature proposal \U0001FA90"
name: New feature proposal 🪐
description: Propose a new feature to be added to TresJS
labels: ["enhancement"]
labels: [enhancement]
body:
- type: markdown
attributes:
Expand All @@ -10,15 +10,15 @@ body:
id: feature-description
attributes:
label: Description
description: "Clear and concise description of the problem. Please make the reason and usecases as detailed as possible. If you intend to submit a PR for this issue, tell us in the description. Thanks!"
description: 'Clear and concise description of the problem. Please make the reason and usecases as detailed as possible. If you intend to submit a PR for this issue, tell us in the description. Thanks!'
placeholder: As a developer using TresJS I want [goal / wish] so that [benefit].
validations:
required: true
- type: textarea
id: suggested-solution
attributes:
label: Suggested solution
description: "In module [xy] we could provide following implementation..."
description: 'In module [xy] we could provide following implementation...'
validations:
required: true
- type: textarea
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# From https://github.com/remirror/template/blob/4f8c5f5629a081217672a8cce1df085510f43913/.github/actions/pnpm/action.yml
name: 'pnpm installation'
description: 'Install and audit dependencies for pnpm'
name: pnpm installation
description: Install and audit dependencies for pnpm
inputs:
cache: # id of input
description: 'The location of the pnpm cache'
description: The location of the pnpm cache
required: true
default: '.pnpm-store'
default: .pnpm-store
version: # id of input
description: 'The version to use'
description: The version to use
required: false
default: 6.10.0

runs:
using: 'composite'
using: composite
steps:
- name: install pnpm
run: npm install pnpm@${{ inputs.version }} -g
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Lint PR'
name: Lint PR

on:
pull_request_target:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run Lint
Expand Down
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ Project maintainers are responsible for clarifying the standards of acceptable b

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope
## Scope

This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team by DM at [TresJS Discord](https://discord.gg/UCr96AQmWn). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.

## Attribution
## Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ Before opening a pull request, make sure to run `pnpm lint` to make sure the cod
- Create a `fix/{issue-number}-fix-test-in-core` branch for this bug fix.
- If you are resolving a special issue, add `(fix #xxx[,#xxx])` (#xxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`.

## Keep core small
## Keep core small

The core package should be as small as possible, it should only contain the core functionality of the library. If you are adding a new feature, please consider adding it as a plugin instead, for example, if you want to add support for [Effect Composer](https://threejs.org/examples/?q=compo#webgl_postprocessing_effectcomposer) you should create a new package called `@tresjs/postprocessing` and add it as a plugin. If it's a smaller scope you can always add it to `cientos` package.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ TresJS nuxt module comes with a devtools extension that allows you to inspect th

To activate the devtools, you need to add the `devtools` option to the `tres` section of `nuxt.config.ts`.


```js
export default defineNuxtConfig({
modules: ['@tresjs/nuxt', '@nuxt/devtools' ],
modules: ['@tresjs/nuxt', '@nuxt/devtools'],
tres: {
devtools: true,
},
Expand All @@ -70,7 +69,7 @@ TresJS nuxt module comes with a vite plugin that allows you to import GLSL shade

```js
export default defineNuxtConfig({
modules: ['@tresjs/nuxt', '@nuxt/devtools' ],
modules: ['@tresjs/nuxt', '@nuxt/devtools'],
tres: {
glsl: true,
},
Expand Down Expand Up @@ -105,8 +104,6 @@ const uniforms = {
</template>
```



## Development

```bash
Expand Down
10 changes: 4 additions & 6 deletions client/components/Graph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ const props = withDefaults(defineProps<{
unit: string
label: string
color: string
}>(),
{
}>(), {
points: () => [],
value: 0,
unit: '',
label: '',
color: 'green',
})
const width = 160
const height = 40
const strokeWidth = 2
Expand All @@ -32,7 +30,7 @@ watchEffect(() => {
const pointsF = computed(() => props.points.map(
(point, index) =>
`${index * strokeWidth},${height - (point * height / maxValue.value)}`,
).join(' '))
).join(' '))
</script>

<template>
Expand All @@ -43,7 +41,7 @@ const pointsF = computed(() => props.points.map(
p-1
rounded
text-right
text-xs
text-xs
outline-none
border-none
font-sans
Expand Down Expand Up @@ -78,4 +76,4 @@ const pointsF = computed(() => props.points.map(
.graph polyline {
stroke: rgba(var(--nui-c-context), 1);
}
</style>
</style>
2 changes: 1 addition & 1 deletion client/components/ModuleAuthorNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
target="_blank"
>
nuxt/devtools
</NLink> repository.<br>
</NLink> repository.<br />
The UI components are coming from <NLink
href="https://github.com/nuxt/devtools/tree/main/packages/devtools-ui-kit"
target="_blank"
Expand Down
4 changes: 2 additions & 2 deletions client/components/Pane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ defineProps<{
-top-2
left-2"
>{{ title }}</span>
<slot />
<slot></slot>
</div>
</template>
</template>
14 changes: 7 additions & 7 deletions client/components/PerformanceMonitor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ const { fps, memory, renderer } = useDevtoolsHook()
<div class="flex flex-col items-center gap-2">
<div class="flex items-center font-mono gap-2">
{{ renderer.info?.memory?.geometries || 0 }}
<i class="i-iconoir-box-3d-three-points" />
<i class="i-iconoir-box-3d-three-points"></i>
</div>
<span class="text-xs text-gray-500">Geometries</span>
</div>
<div class="flex flex-col items-center gap-2">
<div class="flex items-center font-mono gap-2">
{{ renderer.info?.memory?.textures || 0 }}
<i class="i-iconoir-select-face-3d" />
<i class="i-iconoir-select-face-3d"></i>
</div>
<span class="text-xs text-gray-500">Textures</span>
</div>
Expand All @@ -64,28 +64,28 @@ const { fps, memory, renderer } = useDevtoolsHook()
<div class="flex flex-col items-center gap-2 mb4">
<div class="flex items-center font-mono gap-2">
{{ renderer?.info?.render?.calls || 0 }}
<i class="i-iconoir-comp-align-left" />
<i class="i-iconoir-comp-align-left"></i>
</div>
<span class="text-xs text-gray-500">Calls</span>
</div>
<div class="flex flex-col items-center gap-2 mb4">
<div class="flex items-center font-mono gap-2">
{{ renderer?.info?.render?.triangles || 0 }}
<i class="i-iconoir-triangle" />
<i class="i-iconoir-triangle"></i>
</div>
<span class="text-xs text-gray-500">Triangles</span>
</div>
<div class="flex flex-col items-center gap-2 mb4">
<div class="flex items-center font-mono gap-2">
{{ renderer?.info?.render?.points || 0 }}
<i class="i-iconoir-one-point-circle" />
<i class="i-iconoir-one-point-circle"></i>
</div>
<span class="text-xs text-gray-500">Points</span>
</div>
<div class="flex flex-col items-center gap-2 mb4">
<div class="flex items-center font-mono gap-2">
{{ renderer?.info?.render?.lines || 0 }}
<i class="i-iconoir-linear" />
<i class="i-iconoir-linear"></i>
</div>
<span class="text-xs text-gray-500">Lines</span>
</div>
Expand All @@ -97,4 +97,4 @@ const { fps, memory, renderer } = useDevtoolsHook()
<ProgramsModule />
</Pane>
</div>
</template>
</template>
Loading

0 comments on commit 89f6be8

Please sign in to comment.