2022.2.11 • Published 3 years ago
@phanect/eslint-plugin v2022.2.11
@phanect/eslint-plugin
ESLint config for my own projects.
Install
yarn add --dev @phanect/eslint-plugin
Usage
Create an .eslintrc.js like following on the project root:
const { join } = require("path");
module.exports = {
extends: "plugin:@phanect/plain",
root: true,
env: {
browser: true, // or: "node": true
},
// If your project is TypeScript-based, you need to specify the tsconfig.json location
parserOptions: {
project: join(__dirname, "./tsconfig.eslint.json"),
},
plugins: [ "@phanect" ],
// Add sourceType: "module" if you use `import`/`export` syntax in JS. (e.g. JS modules, webpack)
// You don't need this if only use TS. By default, sourceType is "script" in JS and "module" in TS.
// To avoid treating *.cjs files as modules, ensure to use `overrides` to only apply it to *.js.
overrides: [{
files: [ "*.js", "**/*.js" ],
parserOptions: {
sourceType: "module",
},
}],
};
Also create .eslintrc.js in the test directory for test-specific configs:
module.exports = {
extends: "plugin:@phanect/jest",
};
Supported configs:
- plugin:@phanect/plain
- plugin:@phanect/node
- plugin:@phanect/react
- plugin:@phanect/vue+js (Vue 3)
- plugin:@phanect/vue+ts (Vue 3)
- plugin:@phanect/nuxt+js (Nuxt 2 + Vue 2)
- plugin:@phanect/nuxt+ts (Nuxt 2 + Vue 2)
- plugin:@phanect/jest
Test with realworld projects
- Generate npm package
$ cd /path/to/eslint-plugin
$ npm pack
- Install new package on a realworld project
$ cd /path/to/target/project
$ npm install ../eslint-plugin/phanect-eslint-plugin-2022.1.1.tgz
- Test
# $ cd /path/to/target/project
$ npm run lint
2022.2.11
3 years ago
2022.1.30-1
3 years ago
2022.1.30
3 years ago
2021.10.17
4 years ago
2021.8.8
4 years ago
2021.4.25
4 years ago
2021.1.30
4 years ago
2020.12.29
4 years ago
2020.12.20
4 years ago
2020.7.8
5 years ago
2020.3.22
5 years ago
2020.2.16
5 years ago
2020.2.15
5 years ago
2020.1.25
5 years ago
2020.1.5
5 years ago
2019.12.1
6 years ago
2019.11.21-1
6 years ago
2019.11.21
6 years ago
2019.10.29
6 years ago
2019.9.8
6 years ago
2019.8.4-1
6 years ago
2019.8.4
6 years ago
2019.7.28
6 years ago
2019.6.16-1
6 years ago
2019.6.16
6 years ago
2019.6.15
6 years ago
2019.6.9
6 years ago
2019.4.30
6 years ago
2019.2.16
6 years ago