Skip to content

reverentgeek/eslint-config-reverentgeek

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-config-reverentgeek

This package is ReverentGeek's preferred configuration settings for eslint.

Usage (eslint >= v9.0)

  1. Install dependencies.

    npm install --save-dev eslint eslint-config-reverentgeek
  2. Create an eslint.config.js file.

  3. Add the following to the config file.

"use strict";

const defineConfig = require( "eslint/config" ).defineConfig; // eslint-disable-line n/no-unpublished-require
const rg = require( "eslint-config-reverentgeek" ); // eslint-disable-line n/no-unpublished-require

module.exports = defineConfig( [
	{
		extends: [ rg.configs.node ],
		rules: {
		}
	}
] );

The node config adds specific support for Node.js and CommonJS modules.

Alternative Configs

The node-esm config adds specific support for Node.js and ES modules (import/export).

import { defineConfig } from "eslint/config"; // eslint-disable-line n/no-unpublished-import
import rg from "eslint-config-reverentgeek"; // eslint-disable-line n/no-unpublished-import

export default defineConfig( {
	extends: [ rg.configs["node-esm"] ],
	rules: {
	}
} );

The blog config changes the code style to two-spaced indentions, which is better for copying code samples to blog posts.

import { defineConfig } from "eslint/config";
import rg from "eslint-config-reverentgeek";

export default defineConfig( {
  extends: [ rg.configs.browser, rg.configs.blog ]
} );

The react config adds specific support for React, browser, and ES modules (import/export).

npm install --save-dev eslint-plugin-react
import { defineConfig } from "eslint/config";
import rg from "eslint-config-reverentgeek";
import react from "eslint-plugin-react";

export default defineConfig( {
	extends: [ rg.configs.browser, rg.configs.react ],
	plugins: {
		react
	},
	rules: {
	}
} );

The browser config sets the browser environment and adds ES module support.

import { defineConfig } from "eslint/config";
import rg from "eslint-config-reverentgeek";

export default defineConfig( {
	extends: [ rg.configs.browser ]
} );

Legacy .eslintrc.js support (eslint < v9.0)

  1. Install dependencies.

    npm install --save-dev eslint@8 eslint-config-reverentgeek@4
  2. Create an .eslintrc.js file.

  3. Add the following to the config file.

module.exports = {
	extends: [ "reverentgeek" ]
};

Alternative Rule Sets

The blog rule set changes to code style to two-spaced indentions, which is better for copying code samples to blog posts.

module.exports = {
	extends: [ "reverentgeek/blog" ]
};

The node rule set adds specific support for Node.js and CommonJS modules.

"use strict";

module.exports = {
	extends: [ "reverentgeek/node" ]
};

The node/module rule set adds specific support for Node.js and ES modules (import/export).

"use strict";

module.exports = {
	extends: [ "reverentgeek/node/module" ]
};

The browser rule set the browser environment and adds ES module support.

module.exports = {
	extends: [ "reverentgeek/browser" ]
};

About

ESLint configuration that ReverentGeek likes :)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •