2.0.7 • Published 10 months ago

@place-framework/code-config v2.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

PLACE Framework Header

PLACE Code Config

PLACE Framework Ecosystem Diagram

Introduction

This configuration is my personal preferences, linters, and rules when it comes to writing frontend code. It is entirely optional to use in conjunction with your project, and is the baseline default option for the PLACE Webpack Preset.

Implementation

The following configuration files for each formatting system are as follows:

  • babel.config.js - Key: BABEL_CONFIG
  • eslint.config.js - Key: ESLINT_CONFIG
  • prettier.config.js - Key: PRETTIER_CONFIG
  • stylelint.config.js - Key: STYLELINT_CONFIG

Simple Example:

// prettier.config.js

const PRETTIER_CONFIG = require('@place-framework/code-config').PRETTIER_CONFIG;

module.exports = PRETTIER_CONFIG;

Complex Example:

// eslint.config.js

const ESLINT_CONFIG = require('@place-framework/code-config').ESLINT_CONFIG;

module.exports = [
	{
		files: ['**/*.js'],
		plugins: {
			...ESLINT_CONFIG.plugins.stylistic
		},
		rules: {
			...ESLINT_CONFIG.configs.base.rules,
			...ESLINT_CONFIG.configs.stylistic.rules
		}
	}, ESLINT_CONFIG.configs.prettier
];