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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fontoxml/eslint-config

v5.0.1

Published

Fonto's opiniated ESLint base configuration.

Readme

@fontoxml/eslint-config

Opinionated ESLint (and Prettier) configuration used by Fonto.

Installation

Install this package in your project as a development dependency:

npm install --save-dev @fontoxml/eslint-config

A handful of additional (development) dependencies are required for this configuration to work. Make sure to at least install:

This suffices for linting (most) JavaScript/TypeScript (.js(x) / .ts(x)).

Compatibility

Specific versions of ESLint and its TypeScript plugin are compatible with a range of TypeScript versions. As Fonto Editor uses specific versions of TypeScript, make sure to use the correct version of @fontoxml/eslint-config:

  • For Fonto Editor 8.16 and higher use 5.x.x
  • For Fonto Editor 8.15 and lower use 4.x.x

Usage

Using this ESLint configuration usually involves the following files:

  • eslint.config.js

    Configuration file for ESLint which makes use of @fontoxml/eslint-config and adds local configuration.

  • prettier.config.js

    Configuration for Prettier formatting rules which makes use of @fontoxml/eslint-config.

  • .prettierignore To only apply prettier to the same files as the eslint config.

    Configuration for Prettier to only apply on the same files as ESLint.

  • tsconfig.json

    The TypeScript configuration file which is used by the ESLint TypeScript rules. This guide assumes your Fonto editor instance already has a tsconfig.json file, which should be the case when using SDK 8.0.0 or higher.

ESLint configuration file (eslint.config.js)

Simply extend @fontoxml in your ESLint configuration. The following is an example eslint.config.js file which extends this configuration for use in a Fonto editor instance and adds Editor repository specific configuration.

When using CommonJS configuration files

const configFonto = require('@fontoxml/eslint-config');
const globals = require('globals');

module.exports = [
	{
		name: 'fontoxml/global-ignores',
		ignores: ['platform/**', '**/assets/**'],
	},
	...configFonto.default,
	{
		name: 'fontoxml/settings',
		settings: {
			// Explicitly set the React version because this repository has no
			// React dependency. Should be in sync with 'fontoxml-vendors'.
			// See: https://www.npmjs.com/package/eslint-plugin-react
			react: {
				version: '18.2.0',
			},
			// Mark imports starting with 'fontoxml-' as internal for import
			// sorting purposes.
			'import/internal-regex': '^fontoxml-',
		},
	},
	{
		name: 'fontoxml/config-files-commonjs',
		files: [
			'./dev-cms/**/*.js',
			'./config.js',
			'./eslint.config.js',
			'./prettier.config.js',
		],
		languageOptions: {
			globals: {
				...globals.node,
			},
			sourceType: 'commonjs',
		},
	},
];

When using ES Module configuration files

import configFonto from '@fontoxml/eslint-config';
import globals from 'globals';

export default [
	{
		name: 'fontoxml/global-ignores',
		ignores: ['platform/**', '**/assets/**'],
	},
	...configFonto,
	{
		name: 'fontoxml/settings',
		settings: {
			// Explicitly set the React version because this
			// repository has no React dependency. Should be
			// in sync with 'fontoxml-vendors'.
			// See: https://www.npmjs.com/package/eslint-plugin-react
			react: {
				version: '18.2.0',
			},
			// Mark imports starting with 'fontoxml-' as internal
			// for import sorting purposes.
			'import/internal-regex': '^fontoxml-',
		},
	},
	{
		name: 'fontoxml/config-files-esm',
		files: [
			'./dev-cms/**/*.js',
			'./config.js',
			'./eslint.config.js',
			'./prettier.config.js',
		],
		languageOptions: {
			globals: {
				...globals.node,
			},
		},
	},
];

This will configure all rules, and requires all peer dependencies to be installed, including the optional ones. The configuration relies on file extensions to determine which additional rules and plugins to run. For React/JSX the .jsx file extension is assumed and for TypeScript it's both .ts and .tsx.

Prettier configuration file (prettier.config.js)

This ESLint configuration is designed to be used together with Prettier for code formatting. Configuration for Prettier is included in this packages, and can be used By creating a prettier.config.js file in your project next to the eslint.config.js file. The following is an example prettier.config.js file in which the configuration is used as-is:

When using CommonJS configuration files

const fontoPrettierConfig = require('@fontoxml/eslint-config/prettier.config.js');

module.exports = {
	...fontoPrettierConfig.default,
};

When using ES Module configuration files

import fontoPrettierConfig from '@fontoxml/eslint-config/prettier.config.js';

export default {
	...fontoPrettierConfig,
};

Prettier ignore file (.prettierignore)

To make sure it only applies to the same files as the ESLint setup applies, also create a .prettierignore file:

platform/**
**/assets/**

VSCode configuration

Install the ESLint and Prettier extensions. There are also some settings which improve the developer experience and align with the ESLint en prettier configuration.

This can be achieved by creating the following files in the project, restarting VSCode and accepting to install the extensions.

Recommended extensions (.vscode/extensions.json)

{
	"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}

Recommended settings (.vscode/settings.json)

{
	"editor.codeActionsOnSave": {
		"source.fixAll.eslint": "explicit"
	},
	"editor.defaultFormatter": "esbenp.prettier-vscode",
	"editor.formatOnSave": true,
	"editor.insertSpaces": false,
	"editor.rulers": [80, 100],

	"eslint.format.enable": false,
	"eslint.useFlatConfig": true,

	"files.eol": "\n",

	"prettier.requireConfig": true,

	"search.exclude": {
		// These files should never be edited via this project.
		"dist/**": true,
		"node_modules/**": true,
		"platform/**": true,
		"platform-linked/**": true
	},
	"search.useIgnoreFiles": false,

	"typescript.tsdk": "node_modules/typescript/lib",
	"typescript.enablePromptUseWorkspaceTsdk": true
}

Troubleshooting

Migrating between major versions

  1. Upgrade to the new @fontoxml/eslint-config version.
  2. Remove all required peer dependencies of the old @fontoxml/eslint-config version
  3. Install all required peer dependencies of the new @fontoxml/eslint-config version using the correct versions
  4. Remove node_modules, and run npm install again. There are known issues when not doing so when upgrading

Configuration not working for a Fonto Editor

  • Follow version migration troubleshooting
  • Check the configuration files
    • All configuration files are present, including tsconfig.json
    • The configuration files should be placed next to config/, packages/, platform/, config.js(on), manifest.json, tsconfig.json etc.
    • Check if you should use CommonJS or ES Module. This depends on the "type" property in package.json
    • Check if the configuration files are correct, see examples
  • Check there is no other (global) ESLint installations and/or configuration in scope conflicting with this configuration
  • When using VSCode
    • Add .vscode/extensions.json and .vscode/settings.json to the project
    • Either restart VSCode or run >Developer: Restart Extension Host
    • Make sure VSCode is using the Workspace version of TypeScript
    • Make sure VSCode is up to date. Requires at least 1.101.0 due to it shipping with a compatible nodejs version.
  • Check if you are using a compatible Node.js version, which is likely any non end-of-life LTS version of Node.js