Skip to content

Commit

Permalink
scope prettier/eslint/typecheck to source folder only - excluding exa…
Browse files Browse the repository at this point in the history
…mple folders
  • Loading branch information
robertKozik committed Jan 16, 2024
1 parent d4cdddb commit a450039
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 43 deletions.
20 changes: 15 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
**/node_modules/*
**/react-native-live-markdown-parser.js
lib/**/*
*.test.*

# any js file inside android and ios folders
android/**/*.js
ios/**/*.js

# Ignore all files inside subproject folders
example/**/*
*.config.js
WebExample/**/*
parser/**/*

# Output of the build process & scripts
lib/**/*
scripts/**/*

babel.config.js
.eslintrc.js
.prettierrc.js
.prettierrc.js
15 changes: 14 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:import/typescript',
'prettier',
'plugin:prettier/recommended',
],
plugins: [
'react',
Expand All @@ -25,6 +26,18 @@ module.exports = {
},
root: true,
rules: {
'prettier/prettier': [
'error',
{
tabWidth: 2,
singleQuote: true,
trailingComma: 'all',
bracketSpacing: false,
arrowParens: 'always',
printWidth: 190,
singleAttributePerLine: true,
},
],
'rulesdir/prefer-underscore-method': 'off',
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
Expand All @@ -39,7 +52,7 @@ module.exports = {
"tsx": "never"
}
],
'import/no-unresolved': 'error', // no in app
'import/no-unresolved': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'off', // TODO consider enabling this (currently it reports styles defined at the bottom of the file)
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ jobs:

- run: yarn install --immutable

- run: yarn lint
env:
CI: true


- name: Verify there's no Prettier diff
run: |
yarn prettier --loglevel silent
yarn lint --fix --quiet
if ! git diff --name-only --exit-code; then
# shellcheck disable=SC2016
echo 'Error: Prettier diff detected! Please run `npm run prettier` and commit the changes.'
Expand Down
18 changes: 0 additions & 18 deletions .prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc.js

This file was deleted.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .js,.ts,.tsx",
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
"prettier": "prettier --write .",
"prettier-watch": "onchange \"**/*.js\" -- prettier --write --ignore-unknown {{changed}}",
"prepare": "bob build",
"release": "release-it"
},
Expand Down
4 changes: 2 additions & 2 deletions src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* eslint-disable arrow-body-style */
/* eslint-disable @typescript-eslint/no-empty-interface */
import {TextInput} from 'react-native';

import React from 'react';
import type {TextInputProps} from 'react-native';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface MarkdownTextInputProps extends TextInputProps {
// nothing here
}

// eslint-disable-next-line arrow-body-style
const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>((props, ref) => {
// TODO: add web implementation here
return (
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
"typeRoots": ["node_modules/@types"]
},
"include": ["src/**/*", "types/global.d.ts"],
"exclude": ["**/node_modules/**/*", "parser/**/*", "**/lib/**/*", "**/__tests__/**/*", "example/src/**/*", "WebExample/**/*"]
"exclude": ["**/node_modules/**/*", "parser/**/*", "**/lib/**/*", "example/src/**/*", "WebExample/**/*"]
}

0 comments on commit a450039

Please sign in to comment.