Giter Club home page Giter Club logo

eslint-oursky's Introduction

Installation

npm install --save --save-dev --save-exact [email protected] @oursky/eslint-plugin

Usage

In your .eslintrc

{
  "plugins": ["@oursky"],
  // If you are using TypeScript, you need to configure parserOptions.
  "parserOptions": {
    "sourceType": "module",
    "project": "./tsconfig.json"
  },
  "extends": [
    // You should always include these two.
    "plugin:@oursky/eslint",
    "plugin:@oursky/oursky",
    // Include this if you are using TypeScript.
    "plugin:@oursky/typescript",
    "plugin:@oursky/tsdoc",
    // Include these two if your project is React.
    "plugin:@oursky/react",
    "plugin:@oursky/react-hooks",
    // Include this if your project is React Native.
    "plugin:@oursky/react-native"
  ]
}

eslint-oursky's People

Contributors

kiootic avatar louischan-oursky avatar rickmak avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eslint-oursky's Issues

Nested Text component recognized as raw text

"react-native/no-raw-text": "error",

I have trouble passing the lint test due to error when I nest a Text component inside another Text component:

<View>
  ...
  <Text style={styles.footnoteText}>
    {'*Only receipt scanning is available in the app.\n'}
    {'For other document types, please '}
    <Text style={styles.contactUsHyperlink} onPress={openURL}>
      {'contact us'}
    </Text>
    {'.'}
  </Text>
  ...
</View>

Error message:

error  Raw text (*Only receipt scanning is available in the app.) cannot be used outside of a <Text> tag  react-native/no-raw-text

Disable `consistent-return`

Schema error in version 9.0.1

I got these output when trying to use version 9.0.1:

can't resolve reference #/definitions/directiveConfigSchema from id #
can't resolve reference #/definitions/directiveConfigSchema from id #
can't resolve reference #/definitions/directiveConfigSchema from id #
can't resolve reference #/definitions/directiveConfigSchema from id #
can't resolve reference #/definitions/modifier from id #

Config:

module.exports = {
  root: true,
  plugins: ['@oursky'],
  parserOptions: {
    sourceType: 'module',
    project: './tsconfig.json',
  },
  extends: [
    'plugin:@oursky/typescript',
  ],
};

Seems related to typescript-eslint/typescript-eslint#5525

Turn on strict-boolean-expressions

With options

allowString: false
allowNumber: false
allowNullableObject: false
allowNullableBoolean: false
allowNullableString: false
allowNullableNumber: false
allowNullableEnum: false
allowAny: false
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false

Turn off some rules

  • @typescript-eslint/no-explicit-any
  • @typescript-eslint/no-unsafe-member-access
  • @typescript-eslint/no-unsafe-assignment
  • @typescript-eslint/no-unsafe-return
  • @typescript-eslint/no-unsafe-call
  • @typescript-eslint/strict-boolean-expressions
  • array-element-newline
  • no-mixed-operators
  • no-undefined
  • Turn on option allowArgumentsExplicitlyTypedAsAny of @typescript-eslint/explicit-module-boundary-types

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.