@sjmdev/sjm-configs
v0.1.2
Published
SJM Configs contains shared configuration files which are consumed by a variety of SJM projects.
Downloads
1
Keywords
Readme
SJM Configs
Table of Contents
- About
- Installation
- Setup
- Usage
- Data
- Paths
- Configuration Files
- Overview
- List
- Documentation
- Testing
About
SJM Configs contains shared configuration files which are consumed by a variety of SJM projects.
Installation
Install sjm-configs
via npm package registry as follows:
npm install --save-dev @sjmdev/sjm-configs
Setup
Import the sjm-configs
module into a given file as follows:
const sjmConfigs = require( '@sjmdev/sjm-configs' );
Usage
Data
Raw configuration data can be accessed via the sjmConfigs
object as follows:
// Using property access:
const eslintConfig = sjmConfigs.eslintConfig;
// Using object destructuring:
const { eslintConfig } = sjmConfigs;
Paths
sjm-configs
also exposes a paths
object, where each key is an absolute path to the corresponding configuration file. The paths
object can be accessed as follows:
// Using property access:
const sjmConfigPaths = sjmConfigs.paths;
const eslintConfigPath = sjmConfigPaths.eslintConfig;
// Using object destructuring:
const { paths: sjmConfigPaths } = sjmConfigs;
const { eslintConfig: eslintConfigPath } = sjmConfigPaths;
Configuration Files
Overview
This section outlines all configuration files which are present within the sjm-configs
module. See individual entries for details.
List
ESLint
Used by ESLint to enforce consistency and best practices within JavaScript files.
Configuration File: .eslintrc.json
Data Exposed As: eslintConfig
File Path Exposed As: paths.eslintConfig
SASS Lint
Used by SASS Lint to enforce consistency and best practices within SASS/SCSS files.
Configuration File: .sass-lint.json
Data Exposed As: sassLintConfig
File Path Exposed As: paths.sassLintConfig
PHP Code Sniffer
Used by PHP_CodeSniffer to enforce consistency and best practices within PHP files.
NOTE: Currently, this configuration file is not exposed as part of the sjm-configs
public API.
Configuration File: ruleset.xml
Data Exposed As: n/a
File Path Exposed As: n/a
Documentation
Currently, SJM Configs does not include any external documentation.
For an overview of the project's evolution, please consult the CHANGELOG.
Testing
Providing that all development dependencies have been installed, the sjm-configs
test suite can be run as follows:
npm test