Skip to content

Commit

Permalink
feat: move to packages
Browse files Browse the repository at this point in the history
  • Loading branch information
amorino committed Feb 10, 2021
1 parent de27aa3 commit 8946328
Show file tree
Hide file tree
Showing 8 changed files with 484 additions and 59 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# exitorconfig.org
root = true

[*.js,*.json]

charset = utf-8
indent_size = 2
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
28 changes: 27 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,30 @@
# Build products
build/
coverage/
fixtures/
fixtures/

logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Optional eslint cache
.eslintcache

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# Yarn
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
46 changes: 8 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
{
"name": "@amorino/eslint-config",
"version": "1.0.0",
"description": "Personal ESLint config for Next.JS using TypeScript",
"main": "index.js",
"keywords": [
"eslint",
"config"
],
"author": "Erick Bazan <erick.bazan@me.com>",
"license": "MIT",
"peerDependencies": {
"eslint": ">=7",
"typescript": ">=3.7"
},
"devDependencies": {
"eslint": "7.16.0",
"typescript": "^3.9.7"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.2.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/amorino/eslint-config.git"
},
"bugs": {
"url": "https://github.com/amorino/eslint-config/issues"
},
"homepage": "https://github.com/amorino/eslint-config#readme"
}
"name": "@amorino/eslint-config-project",
"scripts": {
"publish": "yarn workspaces foreach npm publish --access=public"
},
"workspaces": [
"packages/*"
]
}
93 changes: 93 additions & 0 deletions packages/eslint-config-native/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
"use strict";

module.exports = {
parser: "@typescript-eslint/parser",

env: {
node: true,
"jest/globals": true,
"react-native/react-native": true,
es2020: true,
},

parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
project: "./tsconfig.json",
},

ignorePatterns: ["/*.*"],

plugins: ["@typescript-eslint", "react-native"],

extends: [
"plugin:@typescript-eslint/recommended",
"@react-native-community",
"plugin:react-native/all",
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
],

rules: {
/**
* General
*/
"no-underscore-dangle": "off",
/**
* React Plugin
* The following rules are made available via `eslint-plugin-react`.
*/
"react/prop-types": "off",
"react/display-name": "off",
"react/jsx-filename-extension": [
1,
{
extensions: [".ts", ".tsx"],
},
],
"react/jsx-props-no-spreading": [
"error",
{
custom: "ignore",
},
],
"react/no-unescaped-entities": "off",
/**
* Prettier plugin
* The following rules are made available via `eslint-plugin-prettier`.
*/
"prettier/prettier": "error",

"@typescript-eslint/explicit-module-boundary-types": "off",
"react-native/no-raw-text": [
2,
{
skip: ["Animated.Text"],
},
],
},
settings: {
react: {
version: "detect",
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
},
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
overrides: [
{
files: ["**/*.js?(x)"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
],
};
44 changes: 44 additions & 0 deletions packages/eslint-config-native/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "@amorino/eslint-config-native",
"version": "1.0.1",
"description": "Personal ESLint config for React Native using TypeScript",
"main": "index.js",
"keywords": [
"eslint",
"react",
"react native",
"config",
"typescript"
],
"author": "Erick Bazán <erick.bazan@me.com>",
"license": "MIT",
"peerDependencies": {
"eslint": ">=7",
"typescript": ">=3.7"
},
"devDependencies": {
"eslint": "7.16.0",
"typescript": "^3.9.7"
},
"dependencies": {
"@react-native-community/eslint-config": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.10.0",
"prettier": "^2.2.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/amorino/eslint-config.git"
},
"bugs": {
"url": "https://github.com/amorino/eslint-config/issues"
},
"homepage": "https://github.com/amorino/eslint-config#readme"
}
16 changes: 6 additions & 10 deletions index.js → packages/eslint-config-next/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
/**
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
"use strict";

module.exports = {
parser: "@typescript-eslint/parser",

env: {
browser: true,
node: true,
Expand All @@ -20,9 +16,11 @@ module.exports = {
ecmaFeatures: {
jsx: true,
},
project: "tsconfig.json",
project: "./tsconfig.json",
},

plugins: ["@typescript-eslint", "react", "react-hooks", "prettier", "jest"],

extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
Expand All @@ -34,8 +32,6 @@ module.exports = {
"prettier/react",
],

plugins: ["@typescript-eslint", "react", "react-hooks", "prettier", "jest"],

settings: {
react: {
version: "detect",
Expand Down
42 changes: 42 additions & 0 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "@amorino/eslint-config-next",
"version": "1.0.1",
"description": "Personal ESLint config for Next.JS using TypeScript",
"main": "index.js",
"keywords": [
"eslint",
"config",
"react",
"next.js",
"typescript"
],
"author": "Erick Bazán <erick.bazan@me.com>",
"license": "MIT",
"peerDependencies": {
"eslint": ">=7",
"typescript": ">=3.7"
},
"devDependencies": {
"eslint": "7.16.0",
"typescript": "^3.9.7"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^4.15.0",
"@typescript-eslint/parser": "^4.15.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.2.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/amorino/eslint-config.git"
},
"bugs": {
"url": "https://github.com/amorino/eslint-config/issues"
},
"homepage": "https://github.com/amorino/eslint-config#readme"
}
Loading

0 comments on commit 8946328

Please sign in to comment.