eslint-config-fccs

1.0.0 • Public • Published

eslint-config-fccs

NPM version build status Test coverage Known Vulnerabilities npm download

Node.js Style Guide for Fccs.

Install

npm i eslint eslint-config-fccs --save-dev

Usage

  • package.json
{
  "devDependencies": {
    "eslint-config-fccs": "1",
    "eslint": "8"
  }
}
  • .eslintrc.js
module.exports = {
  extends: 'eslint-config-fccs',
};

Use with TypeScript project

  • package.json
{
  "devDependencies": {
    "eslint-config-fccs": "1",
    "typescript": "^4.5.2"
  }
}
  • .eslintrc.js
module.exports = {
  extends: 'eslint-config-fccs/typescript',
  parserOptions: {
    // recommend to use another config file like tsconfig.eslint.json and extends tsconfig.json in it.
    // because you may be need to lint test/**/*.test.ts but no need to emit to js.
    // @see https://github.com/typescript-eslint/typescript-eslint/issues/890
    project: './tsconfig.json'
  }
};
  • scripts
{
  "lint": "eslint . --ext .ts"
}
  • settings.json in vscode
{
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    {
      "language": "typescript",
      "autoFix": true
    },
  ]
}

Use with Experimental Features

If you want to use eslint-config-fccs with experimental features such as async function, you should use @babel/eslint-parser parser:

  • package.json
{
  "devDependencies": {
    "eslint-config-fccs": "1",
    "eslint": "8",
    "@babel/core": "7",
    "@babel/eslint-parser": "7"
  }
}
  • .eslintrc.js
module.exports = {
  extends: 'eslint-config-fccs',
  // for experimental features support
  parser: '@babel/eslint-parser',
  rules: {
    // see https://github.com/eslint/eslint/issues/6274
    'generator-star-spacing': 'off',
    'babel/generator-star-spacing': 'off',
  }
};

Use with React in Front-End

If you want to use eslint-config-fccs with react, jsx and es6 modules:

  • package.json
{
  "devDependencies": {
    "eslint-config-fccs": "1",
    "eslint": "8",
    "@babel/core": "7",
    "@babel/eslint-parser": "7",
    "eslint-plugin-react": "7"
  }
}
  • .eslintrc.js
module.exports = {
  extends: 'eslint-config-fccs',
  // for experimental features support
  parser: '@babel/eslint-parser',
  parserOptions: {
    // for es6 module
    sourceType: 'module',
  },
  plugins: [
    'react',
  ],
  rules: {
    // for variables in jsx
    'react/jsx-uses-vars': 'error',
    // see https://github.com/eslint/eslint/issues/6274
    'generator-star-spacing': 'off',
    'babel/generator-star-spacing': 'off',
  },
};

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-config-fccs

Weekly Downloads

2

Version

1.0.0

License

none

Unpacked Size

96.5 kB

Total Files

24

Last publish

Collaborators

  • hybnx