npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@starton/eslint-config-nextjs

v1.2.1

Published

Library including the code standard for NextJS projects from Starton.

Downloads

12

Readme

Starton Banner

Starton - Code standard for TypeScript project

Library including the code standard for NextJS projects from Starton.

Requirements

You will need :

Installation

To install the project, first clone the repository and go inside project directory, then :

  • With yarn :

    $ yarn install
  • With NPM :

    $ npm install

Modify the .eslintrc or .eslintrc.js file in your project to include the following code:

{
  "extends": [ "next/core-web-vitals", "@starton/eslint-config-nextjs" ]
}

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

  • NODE_ENV : is a system environment variable that Node exposes into running scripts
  • URL : the URL of the documentation (example: https://docs.starton.com)
  • SEGMENT_KEY : Segment API key
  • GTM_KEY : Google Tag Manager API Key

With VS Code

You should read this entire thing. Serious!

Once you have done one, or both, of the above installs. You probably want your editor to lint and fix for you. Here are the instructions for VS Code:

  1. Install the ESLint package
  2. Now we need to setup some VS Code settings via Code/FilePreferencesSettings. It's easier to enter these settings while editing the settings.json file, so click the Open (Open Settings) icon in the top right corner:
{
  // These are all my auto-save configs
  "editor.formatOnSave": true,
  // turn it off for JS and JSX, we will do this via eslint
  "[javascript]": {
	"editor.formatOnSave": false
  },
  "[javascriptreact]": {
	"editor.formatOnSave": false
  },
  // show eslint icon at bottom toolbar
  "eslint.alwaysShowStatus": true,
  // tell the ESLint plugin to run on save
  "editor.codeActionsOnSave": {
	"source.fixAll": true
  }
}

After attempting to lint your file for the first time, you may need to click on 'ESLint' in the bottom right and select 'Allow Everywhere' in the alert window.

Finally you'll usually need to restart VS code. They say you don't need to, but it's never worked for me until I restart.

With JetBrains Products (IntelliJ IDEA, WebStorm, RubyMine, PyCharm, PhpStorm, etc)

If you have previously configured ESLint to run via a File Watcher, turn that off.

If you choose Local / Per Project Install Above

  1. Open ESLint configuration by going to File > Settings (Edit > Preferences on Mac) > Languages & Frameworks > Code Quality Tools > ESLint (optionally just search settings for "eslint")
  2. Select Automatic ESLint Configuration
  3. Check Run eslint --fix on save

Ensure the Prettier plugin is disabled if installed.

  1. Open Prettier configuration by going to File > Settings (Edit > Preferences on Mac) > Languages & Frameworks > Code Quality Tools > Prettier (optionally just search settings for "prettier")
  2. Uncheck both On code reformat and On save
  3. Optional BUT IMPORTANT: If you have the Prettier extension enabled for other languages like CSS and HTML, turn it off for JS since we are doing it through Eslint already.
    1. Make sure the Run for files glob does not include js,ts,jsx,tsx.
    2. An example glob for styles, config, and markdown. {**/*,*}.{yml,css,sass,md}

Documentation

Find out more on how to use Starton in our Documentation

Contributing

Contributions are always welcome!

See Contributing for ways to get started.

Please adhere to Starton's Code of Conduct.

License

Apache License 2.0

Authors