WIP 1
This commit is contained in:
parent
c095fa7042
commit
43bfdaa1e3
186 changed files with 276 additions and 37155 deletions
6
packages/eslint-config/profile/browser.js
Normal file
6
packages/eslint-config/profile/browser.js
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
const path = require("path");
|
||||
module.exports = {
|
||||
extends: ["xo-space/browser", path.join(__dirname, "common.js")],
|
||||
env: {},
|
||||
rules: {},
|
||||
};
|
||||
113
packages/eslint-config/profile/common.js
Normal file
113
packages/eslint-config/profile/common.js
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
module.exports = {
|
||||
// root: true,
|
||||
ignorePatterns: ["node_modules", "build", "coverage"],
|
||||
plugins: [
|
||||
// Plugin documentation: https://www.npmjs.com/package/eslint-plugin-unicorn
|
||||
"unicorn",
|
||||
// Plugin documentation: https://github.com/dustinspecker/eslint-plugin-no-use-extend-native
|
||||
"no-use-extend-native",
|
||||
// Plugin documentation: https://github.com/xjamundx/eslint-plugin-promise
|
||||
"promise",
|
||||
// Plugin documentation: https://github.com/benmosher/eslint-plugin-import
|
||||
"import",
|
||||
// Plugin documentation: https://github.com/mysticatea/eslint-plugin-eslint-comments
|
||||
"eslint-comments",
|
||||
],
|
||||
extends: ["plugin:unicorn/recommended", "prettier"],
|
||||
env: {},
|
||||
rules: {
|
||||
// these are handled by prettier
|
||||
quotes: "off",
|
||||
"object-curly-spacing": "off",
|
||||
"comma-dangle": "off",
|
||||
|
||||
// reduce the tyranny
|
||||
"capitalized-comments": "off",
|
||||
"new-cap": "off",
|
||||
|
||||
// plugin rules
|
||||
"no-use-extend-native/no-use-extend-native": "error",
|
||||
// this one breaks libraries like Ramda and lodash
|
||||
"unicorn/no-array-callback-reference": "off",
|
||||
"unicorn/filename-case": "off",
|
||||
"unicorn/better-regex": [
|
||||
"error",
|
||||
{
|
||||
sortCharacterClasses: false,
|
||||
},
|
||||
],
|
||||
"unicorn/prevent-abbreviations": "off",
|
||||
"unicorn/consistent-function-scoping": "off",
|
||||
"unicorn/no-useless-undefined": "off",
|
||||
"unicorn/no-array-reduce": "off",
|
||||
"unicorn/no-array-for-each": "off",
|
||||
"unicorn/prefer-ternary": "off",
|
||||
"unicorn/text-encoding-identifier-case": "off",
|
||||
"unicorn/numeric-separators-style": "off",
|
||||
"function-call-argument-newline": "off",
|
||||
"promise/param-names": "error",
|
||||
"promise/no-return-wrap": [
|
||||
"error",
|
||||
{
|
||||
allowReject: true,
|
||||
},
|
||||
],
|
||||
"promise/no-new-statics": "error",
|
||||
"promise/no-return-in-finally": "error",
|
||||
"promise/valid-params": "error",
|
||||
"promise/prefer-await-to-then": "error",
|
||||
"import/default": "error",
|
||||
"import/export": "error",
|
||||
"import/extensions": [
|
||||
"error",
|
||||
{
|
||||
js: "never",
|
||||
jsx: "never",
|
||||
json: "always",
|
||||
svg: "always",
|
||||
css: "always",
|
||||
test: "ignorePackages",
|
||||
},
|
||||
],
|
||||
|
||||
"import/namespace": [
|
||||
"error",
|
||||
{
|
||||
allowComputed: true,
|
||||
},
|
||||
],
|
||||
"import/no-absolute-path": "error",
|
||||
"import/no-anonymous-default-export": "error",
|
||||
"import/no-named-default": "error",
|
||||
"import/no-webpack-loader-syntax": "error",
|
||||
"import/no-self-import": "error",
|
||||
|
||||
"import/no-useless-path-segments": [
|
||||
"error",
|
||||
{
|
||||
noUselessIndex: true,
|
||||
},
|
||||
],
|
||||
"import/no-amd": "error",
|
||||
"import/no-duplicates": "error",
|
||||
|
||||
// enable this when this is fixed
|
||||
// https://github.com/benmosher/eslint-plugin-import/pull/1696
|
||||
"import/no-extraneous-dependencies": "off",
|
||||
|
||||
"import/no-mutable-exports": "error",
|
||||
"import/no-named-as-default-member": "error",
|
||||
"import/no-named-as-default": "error",
|
||||
"eslint-comments/no-aggregating-enable": "error",
|
||||
"eslint-comments/no-duplicate-disable": "error",
|
||||
"eslint-comments/no-unused-disable": "error",
|
||||
"eslint-comments/no-unused-enable": "error",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
9
packages/eslint-config/profile/cypress.js
Normal file
9
packages/eslint-config/profile/cypress.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const path = require("path");
|
||||
module.exports = {
|
||||
extends: ["plugin:cypress/recommended"],
|
||||
plugins: ["cypress"],
|
||||
env: {
|
||||
"cypress/globals": true,
|
||||
},
|
||||
rules: {},
|
||||
};
|
||||
14
packages/eslint-config/profile/jest.js
Normal file
14
packages/eslint-config/profile/jest.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
const path = require("path");
|
||||
module.exports = {
|
||||
extends: ["plugin:jest/recommended"],
|
||||
plugins: [
|
||||
// Plugin documentation: https://www.npmjs.com/package/eslint-plugin-jest
|
||||
"jest",
|
||||
],
|
||||
env: {
|
||||
"jest/globals": true,
|
||||
},
|
||||
rules: {
|
||||
"jest/valid-expect": "off",
|
||||
},
|
||||
};
|
||||
9
packages/eslint-config/profile/node.js
Normal file
9
packages/eslint-config/profile/node.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const path = require("path");
|
||||
module.exports = {
|
||||
extends: ["xo-space", path.join(__dirname, "common.js")],
|
||||
env: {
|
||||
es2021: true,
|
||||
node: true,
|
||||
},
|
||||
rules: {},
|
||||
};
|
||||
23
packages/eslint-config/profile/typescript.js
Normal file
23
packages/eslint-config/profile/typescript.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
module.exports = {
|
||||
parser: "@typescript-eslint/parser",
|
||||
parserOptions: { project: "./tsconfig*json" },
|
||||
plugins: [
|
||||
// Plugin documentation: https://www.npmjs.com/package/@typescript-eslint/eslint-plugin
|
||||
"@typescript-eslint/eslint-plugin",
|
||||
],
|
||||
extends: ["plugin:@typescript-eslint/recommended"],
|
||||
rules: {
|
||||
"no-useless-constructor": "off",
|
||||
"no-unused-vars": "off",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
argsIgnorePattern: "^_",
|
||||
},
|
||||
],
|
||||
"no-extra-semi": "off",
|
||||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-extra-semi": "error",
|
||||
},
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue