You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do you think is the correct solution to this problem?
Warning: It is a breaking change because, packages made with standard-engine would need to provide a prettierConfig path and a prettier instance.
New options.js with prettierConfig
consteslint=require('eslint')constprettier=require("prettier")constpath=require('path')constpkg=require('./package.json')module.exports={// homepage, version and bugs pulled from package.jsonversion: pkg.version,homepage: pkg.homepage,bugs: pkg.bugs.url,eslint: eslint,// pass any version of eslint >= 1.0.0prettier: prettier,// pass any version of prettier >= 2.0.0cmd: 'pocketlint',// should match the "bin" key in your package.jsontagline: 'Live by your own standards!',// displayed in output --helpeslintConfig: {configFile: path.join(__dirname,'eslintrc.json')},prettierConfig: {configFile: path.join(__dirname,'.prettierrc.json')},cwd: ''// current working directory, passed to eslint}
New CLI flag --format
New options for engine.lintFiles (format: boolean):
{// unique to lintTextfilename: '',// path of file containing the text being linted// common to lintText and lintFilescwd: '',// current working directory (default: process.cwd())fix: false,// automatically fix problemsformat: true,// aggressively format code for consistencyextensions: [],// file extensions to lint (has sane defaults)globals: [],// custom global variables to declareplugins: [],// custom eslint pluginsenvs: [],// custom eslint environmentparser: '',// custom js parser (e.g. babel-eslint)usePackageJson: true,// use options from nearest package.json?useGitIgnore: true// use file ignore patterns from .gitignore?}
If format: true, it means we use the prettier api to format the code and also once prettier formatting is done, we also lint the files, so basically, if format: true, then implicitly fix: true because if we format we also lint.
Are you willing to submit a pull request to implement this change?
Yes!
The text was updated successfully, but these errors were encountered:
What problem do you want to solve?
Making
standard
ecosystem easier to use!As discussed in : standard/ts-standard#102, standard/standard#1356, standard/standard#811
There is already prettier-standard but it would be cool, if it could work out of the box for packages like
standard
,semistandard
,standardx
,ts-standard
etc.What do you think is the correct solution to this problem?
Warning: It is a breaking change because, packages made with
standard-engine
would need to provide aprettierConfig
path and a prettier instance.options.js
withprettierConfig
New CLI flag
--format
New options for
engine.lintFiles
(format: boolean):If
format: true
, it means we use the prettier api to format the code and also once prettier formatting is done, we also lint the files, so basically, ifformat: true
, then implicitlyfix: true
because if we format we also lint.Are you willing to submit a pull request to implement this change?
Yes!
The text was updated successfully, but these errors were encountered: