Registry / testing / stylelint-formatter-table

stylelint-formatter-table

JSON →
library1.0.4jsnpmunverified

A table formatter for Stylelint that outputs lint results in a readable tabular format. Current stable version is 1.0.4 (as of 2023). This is a small utility with no active development; designed for CLI, Webpack, gulp, and grunt integrations. Key differentiator: simple table layout with colorized severity indicators, easier to scan than default JSON or verbose output.

npm install stylelint-formatter-table
INSTALL
IMPORT
SIG · STYLELINT-FORMATTE
S
stylelint-formatter-table
testingjavascriptv1.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import stylelintFormatter from 'stylelint-formatter-table'
const stylelintFormatter = require('stylelint-formatter-table').default
This package exports a single default function. For CommonJS, use require without .default.
stylelintFormatter
const stylelintFormatter = require('stylelint-formatter-table')
const stylelintFormatter = require('stylelint-formatter-table').default
In CommonJS, the module.exports is the function itself, not an object with .default.
TypeScript usage
import stylelintFormatter from 'stylelint-formatter-table'
import { stylelintFormatter } from 'stylelint-formatter-table'
No named export; use default import. No type definitions shipped, use @types or declare module.

Shows how to use the table formatter both via CLI and programmatically with ESM imports.

// Run stylelint with this formatter via CLI // npx stylelint *.css --custom-formatter=node_modules/stylelint-formatter-table // Or programmatically (Node.js) import stylelint from 'stylelint'; import stylelintFormatter from 'stylelint-formatter-table'; const result = await stylelint.lint({ files: '*.css', formatter: stylelintFormatter, }); console.log(result.output);
Debug
Known issues
gotchaModule is not ESM-ready: package.json lacks 'type: module' or 'exports' field.
fix
Use CommonJS require() or set up a bundler that handles CJS. Alternatively, use dynamic import().
affects: >=1.0.0
gotchaNo TypeScript type definitions: package does not include .d.ts files.
fix
Create a declaration file (e.g., 'declare module 'stylelint-formatter-table'' in a .d.ts file).
affects: >=1.0.0
gotchaVersion 1.0.4 was published 5+ years ago; no updates or fixes.
fix
Check if the formatter meets your current Stylelint version's API. For newer Stylelint (>=14), the formatter API may have changed; test compatibility.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'stylelint-formatter-table'
Module not installed or not in node_modules.
fix
Run 'npm install stylelint-formatter-table --save-dev'.
TypeError: stylelintFormatter is not a function
Using default import incorrectly (e.g., import { stylelintFormatter } or .default).
fix
Use 'import stylelintFormatter from 'stylelint-formatter-table'' or CommonJS require.
stylelint: Unknown formatter option
Passing the formatter incorrectly to stylelint API.
fix
Ensure you pass the formatter function directly, not a string path. For CLI use --custom-formatter flag with absolute or relative path.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
stylelint-formatter-table — npm install stylelint-formatter-table · libregistry