wispbit logo
wispbit
  • Rules
  • Blog
  • Pricing
Categories
  • typescript
    26
  • postgresql
    22
  • migrations
    22
  • prisma
    14
  • python
    13
  • supabase
    13
  • drizzle
    13
  • react
    10
  • nextjs
    9
  • sqlalchemy
    8
  • alembic
    8
  • golang
    7
  • mysql
    4
  • ruby
    3
  • rails
    3
  • rust
    3
  • markdown
    2
  • php
    2
  • javascript
    2
  • vue
    2
  • css
    1
  • expressjs
    1
  • flask
    1
  • quart
    1
  • graphql
    1
  • shell
    1
  • tailwind
    1

javascript Rules

2 rules found for javascript

Prefer with syntax in Typescript

Use the newer with syntax for JSON imports instead of the deprecated assert syntax for Node.js compatibility. Bad: `javascript import data from "./data.json" assert { type: "json" } ` Good: `javascript import data from "./data.json" with { type: "json" } `

typescript

javascript

Prefer Composition API over Options API in Vue components

Favor the Composition API (<script setup> or setup() function) instead of the Options API when writing new Vue components. Bad – Options API component `vue <script> export default { name: "Counter", data() { return { count: 0, } }, methods: { increment() { this.count++ }, }, mounted() { console.log(The initial count is ${this.count}.) }, } </script> <template> <button @click="increment">Count is: {{ count }}</button> </template> ` Good – Composition API component (<script setup>) `vue <script setup lang="ts"> import { ref, onMounted } from "vue" const count = ref(0) function increment() { count.value++ } onMounted(() => { console.log(The initial count is ${count.value}.) }) </script> <template> <button @click="increment">Count is: {{ count }}</button> </template> `

vue

typescript

javascript

wispbit

Code review that fixes tribal knowledge

Book a demoPrivacy policyTerms of service