ESLint One for All Made Easy

Rate this content
Bookmark

Introduction to ESLint's new flat config format and see how it can bring new possibilities and enhancements to your development workflow and experience.

This talk has been presented at React Day Berlin 2024, check out the latest edition of this React Conference.

FAQ

ESLink can support JavaScript, TypeScript, Vue, Svelte, Astro, JSON, YAML, TOML, GraphQL, HTML, MDX, and more, with various plugins extending its functionality to these languages.

Anthony Fu maintains projects including ESLink, StyleAsync, Shiki, and 2slash.

The FlatConfig allows full control with JavaScript, uses native imports, simplifies inheritance and overriding, and enables factory functions for shared configs to provide more customization options.

You can use the CLI tool eslink-migrate-config to automatically convert your legacy config file to the new FlatConfig format, along with checking ESLink docs and the migration guide for detailed instructions.

Anthony Fu is a coaching member of Vit, Vue, and Nuxt, and a creator of open source projects like Vitest, Lightdiv, and Unocetus. He maintains projects such as ESLink, StyleAsync, Shiki, and 2slash.

Yes, ESLink can be used as a formatter, offering more flexibility and customizability than dedicated formatters like Prettier, especially through its pluggable nature.

ESLink's FlatConfig is a new configuration system introduced in ESLink v9.0 that uses a single JavaScript config file (eslinked.config.js) as a source of truth, providing more explicit control and simplicity compared to the legacy .eslinked-rc config.

The ESLink Config Inspector is a visual tool that allows users to inspect and interact with their final resolved ESLink config, providing a UI to see configuration items, rule sets, and options.

Slidev is a markdown-based presentation tool built on top of web technologies, created by Anthony Fu to present code more flexibly.

You can find Anthony Fu's slides and more information on his website at antfu.me.

Anthony Fu
Anthony Fu
21 min
16 Dec, 2024

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Hello everyone! I'm Anthony Fu, a coaching member of Vit, Vue, and Nuxt. Today, I'll share my findings and practices in exploring ESLink and its ecosystem. ESLink v9.0 released 7 months ago with the new FlatConfig, which simplifies plugin configuration and provides full control and customization in JavaScript. Migrate legacy config to FlatConfig with eslink-migrate-config CLI and use eslink-config-inspector for visualized step tool. Flag config utilities make config customization easier and allow project-aware configs. ESLink is a powerful AST toolkit and can be used as a formatter. Use ESLink for maintaining stylistic rules and customize it to fit your project's needs.
Available in Español: ESLint Uno para Todos Hecho Fácil

1. Introduction to ESLink and its Ecosystem

Short description:

Hello everyone! I'm Anthony Fu, a coaching member of Vit, Vue, and Nuxt. I'm passionate about open source, building tools, and finding solutions to problems. Today, I'll share my findings and practices in exploring ESLink and its ecosystem.

Hello everyone, thanks a lot for having me and hope you're enjoying the conference so far. It's a bit shame that I couldn't come to Berlin in person this time, but I hope you will find my topic today interesting.

So first, let me introduce myself a bit. My name is Anthony Fu and I'm the coaching member of Vit, Vue, and Nuxt. I also create a few open source projects like Vitest, Lightdiv, Unocetus, et cetera. I'm also maintaining a few projects like ESLink, StyleAsync, Shiki, 2slash, and so on. I'm currently working at Nuxt Lab on the framework team.

So, as you can see, I'm pretty enthusiastic about open source, which driven me to work on a lot of projects. I love building tools and figuring out solutions of problems I encountered. For example, the slide you are looking at is powered by Slidev, a markdown-based presentation tool that's built on top of web technologies. It was born when I found the existing tools were not flexible enough for me to present my code. Similarly, when I look into ESLink and its ecosystem a few months ago, I find many things are quite interesting with a lot of potential, but was not yet fully explored. So today I would like to share with you some of my findings and practice during my recent explorations around it.

2. ESLink's Evolution and the FlatConfig

Short description:

ESLink, one for all, made easy. ESLinked v9.0 released 7 months ago with the new FlatConfig. The legacy .eslinked-rc config compared to the new eslinked.config.js FlatConfig. FlatConfig uses native imports, simplifies plugin configuration, and eliminates complex tree structures in shared config. Planned for 5 years, the FlatConfig provides full control and customization in JavaScript.

So, 11 years since ESLink came out, at this moment, it's easily one of the most popular tools in the JavaScript ecosystem that almost every project uses. Despite it has been around for such a long time, it's a tool that's still consistently improving and evolving.

Today, I'd like to give you a bored and ambitious topic, ESLinked, one for all, made easy. To share with you some of the new perspectives and patterns of using ESLinked with the latest features that they just rolled out.

So you're probably already aware that ESLinked v9.0 was released around 7 months ago. The main highlight of this major version is the rolling out of the new configuration system for ESLinked, called the FlatConfig. In case you never heard about it or haven't dig into the docs yet, here let me do a quick comparison between the legacy ESLinked-RC config and the new FlatConfig for you.

To differentiate between those two config formats is rather straightforward. The legacy config is named .eslinked-rc, that supports various extensions, which might also read it from your package.json. The FlatConfig, on the other hand, would only load from eslinked.config.js, a JavaScript config file as a single source of truth.

And when it comes to reusing the shared config, the legacy config formats implicitly use a conventional-based extends properties to load the config from your local node modules. You would need to learn the convention a little bit to know how it resolves. While the FlatConfig will use native imports, where it's more explicit and gives you a lot more control.

And for plugins, in the legacy config, it takes an array of strings, which is again a convention-based and coupled with a plugin's package name. Now in the FlatConfig, it takes a named object for plugins. This means you can now rename plugins easily or switch to a fork without being forced to change every rule in your config.

Also, due to the inherent nature of extends, might result a very complex tree structure in the shared config, because the shared config can also have nested extends inside. In the FlatConfig, it gets a lot simpler. When you explicitly import the shared config as a multiple objects or arrays, and you can compose them into a single flat one, and that's also why it's called FlatConfig.

And for a little bit more context, here is a graph I drew to demonstrate the timeline. While the FlatConfig might sound new to some of you, it has actually been planned for 5 years already. The RFC was created in January 2019. The first imputation is available in version 8.21, ax experimental, which was two years ago. It becomes stable in version 8.45, and then it becomes the default in the recent version 9. In between, the ESLink team has published multiple blog posts to explain the reason why they want to introduce a new format, and share the roadmap of rolling out. That's a lot of effort spent across in this five years plan. So huge respect to the ESLink team.

So as we mentioned in the previous slides, the biggest benefit of FlatConfig is now is in JavaScript, where you have the full control. It uses native import to resolve the plugins and the configs, making the inheritance and the overriding a lot simpler. Because it's full in JavaScript, shared config can be a factory function that takes users' options, and the user can have a lot more capability to do customizations to their specific needs.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Everything Beyond State Management in Stores with Pinia
Vue.js London Live 2021Vue.js London Live 2021
34 min
Everything Beyond State Management in Stores with Pinia
Top Content
State management is not limited to complex applications and transitioning to a store offers significant benefits. Pinia is a centralized state management solution compatible with Vue 2 and Vue 3, providing advanced devtools support and extensibility with plugins. The core API of Pinia is similar to Vuex, but with a less verbose version of stores and powerful plugins. Pinia allows for easy state inspection, error handling, and testing. It is recommended to create one file per store for better organization and Pinia offers a more efficient performance compared to V-rex.
Welcome to Nuxt 3
Vue.js London Live 2021Vue.js London Live 2021
29 min
Welcome to Nuxt 3
Top Content
Nux3 has made significant improvements in performance, output optimization, and serverless support. Nuxt Bridge brings the Nitro engine for enhanced performance and easier transition between Nuxt 2 and Nuxt Read. Nuxt 3 supports Webpack 5, Bytes, and Vue 3. NextLab has developed brand new websites using Docus technology. Nuxt.js is recommended for building apps faster and simpler, and Nuxt 2 should be used before migrating to Nuxt 3 for stability. DOCUS is a new project that combines Nuxt with additional features like content modules and an admin panel.
One Year Into Vue 3
Vue.js London Live 2021Vue.js London Live 2021
20 min
One Year Into Vue 3
Top Content
Vue 3 has seen significant adoption and improvements in performance, bundle size, architecture, and TypeScript integration. The ecosystem around Vue 3 is catching up, with new tools and frameworks being developed. The Vue.js.org documentation is undergoing a complete overhaul. PNIA is emerging as the go-to state management solution for Vue 3. The options API and composition API are both viable options in Vue 3, with the choice depending on factors such as complexity and familiarity with TypeScript. Vue 3 continues to support CDN installation and is recommended for new projects.
Utilising Rust from Vue with WebAssembly
Vue.js London Live 2021Vue.js London Live 2021
8 min
Utilising Rust from Vue with WebAssembly
Top Content
In this Talk, the speaker demonstrates how to use Rust with WebAssembly in a Vue.js project. They explain that WebAssembly is a binary format that allows for high-performance code and less memory usage in the browser. The speaker shows how to build a Rust example using the WasmPack tool and integrate it into a Vue template. They also demonstrate how to call Rust code from a Vue component and deploy the resulting package to npm for easy sharing and consumption.
Vue: Feature Updates
Vue.js London 2023Vue.js London 2023
44 min
Vue: Feature Updates
Top Content
Watch video: Vue: Feature Updates
The Talk discusses the recent feature updates in Vue 3.3, focusing on script setup and TypeScript support. It covers improvements in defining props using imported types and complex types support. The introduction of generic components and reworked signatures for defined components provides more flexibility and better type support. Other features include automatic inference of runtime props, improved define emits and defined slots, and experimental features like reactive props destructure and define model. The Talk also mentions future plans for Vue, including stabilizing suspense and enhancing computer invalidations.
Local State and Server Cache: Finding a Balance
Vue.js London Live 2021Vue.js London Live 2021
24 min
Local State and Server Cache: Finding a Balance
Top Content
This Talk discusses handling local state in software development, particularly when dealing with asynchronous behavior and API requests. It explores the challenges of managing global state and the need for actions when handling server data. The Talk also highlights the issue of fetching data not in Vuex and the challenges of keeping data up-to-date in Vuex. It mentions alternative tools like Apollo Client and React Query for handling local state. The Talk concludes with a discussion on GitLab going public and the celebration that followed.

Workshops on related topic

Vue3: Modern Frontend App Development
Vue.js London Live 2021Vue.js London Live 2021
169 min
Vue3: Modern Frontend App Development
Top Content
Featured WorkshopFree
Mikhail Kuznetsov
Mikhail Kuznetsov
The Vue3 has been released in mid-2020. Besides many improvements and optimizations, the main feature of Vue3 brings is the Composition API – a new way to write and reuse reactive code. Let's learn more about how to use Composition API efficiently.

Besides core Vue3 features we'll explain examples of how to use popular libraries with Vue3.

Table of contents:
- Introduction to Vue3
- Composition API
- Core libraries
- Vue3 ecosystem

Prerequisites:
IDE of choice (Inellij or VSC) installed
Nodejs + NPM
Monitoring 101 for React Developers
React Summit US 2023React Summit US 2023
107 min
Monitoring 101 for React Developers
Top Content
WorkshopFree
Lazar Nikolov
Sarah Guthals
2 authors
If finding errors in your frontend project is like searching for a needle in a code haystack, then Sentry error monitoring can be your metal detector. Learn the basics of error monitoring with Sentry. Whether you are running a React, Angular, Vue, or just “vanilla” JavaScript, see how Sentry can help you find the who, what, when and where behind errors in your frontend project. 
Workshop level: Intermediate
Using Nitro – Building an App with the Latest Nuxt Rendering Engine
Vue.js London Live 2021Vue.js London Live 2021
117 min
Using Nitro – Building an App with the Latest Nuxt Rendering Engine
Top Content
Workshop
Daniel Roe
Daniel Roe
We'll build a Nuxt project together from scratch using Nitro, the new Nuxt rendering engine, and Nuxt Bridge. We'll explore some of the ways that you can use and deploy Nitro, whilst building a application together with some of the real-world constraints you'd face when deploying an app for your enterprise. Along the way, fire your questions at me and I'll do my best to answer them.
TresJS create 3D experiences declaratively with Vue Components
Vue.js London 2023Vue.js London 2023
137 min
TresJS create 3D experiences declaratively with Vue Components
Workshop
Alvaro Saburido
Alvaro Saburido
- Intro 3D - Intro WebGL- ThreeJS- Why TresJS- Installation or Stackblitz setup - Core Basics- Setting up the Canvas- Scene- Camera- Adding an object- Geometries- Arguments- Props- Slots- The Loop- UseRenderLoop composable- Before and After rendering callbacks- Basic Animations- Materials- Basic Material- Normal Material- Toon Material- Lambert Material- Standard and Physical Material- Metalness, roughness - Lights- AmbientLight- DirectionalLight- PointLights- Shadows- Textures- Loading textures with useTextures- Tips and tricks- Misc- Orbit Controls- Loading models with Cientos- Debugging your scene- Performance
Building Vue forms with VeeValidate
Vue.js London Live 2021Vue.js London Live 2021
176 min
Building Vue forms with VeeValidate
Workshop
Abdelrahman Awad
Abdelrahman Awad
In this workshop, you will learn how to use vee-validate to handle form validation, manage form values and handle submissions effectively. We will start from the basics with a simple login form all the way to using the composition API and building repeatable and multistep forms.

Table of contents:
- Introduction to vee-validate
- Building a basic form with vee-validate components
- Handling validation and form submissions
- Building validatable input components with the composition API
- Field Arrays and repeatable inputs
- Building a multistep form
Prerequisites:
VSCode setup and an empty Vite + Vue project.
Building Pinia From Scratch
Vue.js Live 2024Vue.js Live 2024
70 min
Building Pinia From Scratch
Workshop
Eduardo San Martin Morote
Eduardo San Martin Morote
Let's dive into how Pinia works under the hood by building our own `defineStore()`. During this workshop we will cover some advanced Vue concepts like dependency Injection and effect scopes. It will give you a better understanding of Vue.js Composition API and Pinia. Requirements: experience building applications with Vue and its Composition API.