<commit_before>#######################################################################################
# React Plugin
#######################################################################################

plugins:
  - react

extends:
  - plugin:react/recommended

rules:
  react/jsx-no-undef:
    - error
  react/jsx-pascal-case:
    - error
    - allowAllCaps: true
      ignore: []
  react/jsx-uses-react:
    - error
  react/jsx-uses-vars:
    - error
  react/jsx-filename-extension:
    - error
    - extensions: [ ".js" ]

  # Developer Support
  react/display-name: error
  react/require-render-return: error
  react/jsx-key: error

  # Bad practise
  react/no-children-prop: error

  # Make sure React is imported when using JSX
  react/react-in-jsx-scope: error

  # Good idea but currently warns on too many false issues
  react/no-unused-prop-types: off

  # Good idea but currently breaks with helper rendering methods for functional components
  react/no-multi-comp: off

  # Clean code
  react/prefer-es6-class: error
  react/prefer-stateless-function: error
  react/self-closing-comp: error
  react/sort-comp: error
  react/jsx-wrap-multilines: error

  # Formatting
  react/jsx-closing-bracket-location:
    - error
    - line-aligned
  react/jsx-curly-spacing:
    - error
  react/jsx-handler-names:
    - off
  react/jsx-indent:
    - error
    - 2
  react/jsx-indent-props:
    - error
    - 2

  # Unsafe
  react/no-danger: error
  react/no-danger-with-children: error
  react/no-direct-mutation-state: error
  react/no-unescaped-entities: error
  react/style-prop-object: error
  react/jsx-no-duplicate-props:
    - error
    - ignoreCase: true
  react/jsx-no-target-blank: error

  # Don't pollute DOM
  react/no-unknown-property: error

  # Deprecated
  react/no-deprecated: error
  react/no-is-mounted: error
  react/no-string-refs: error

  # Unsafe + Bad performance + Deprecated
  react/no-find-dom-node: error

  # Bad performance
  react/no-did-mount-set-state: error
  react/no-did-update-set-state: error
  react/jsx-no-bind: warn<commit_msg>Cleaned up react list + docs<commit_after>#######################################################################################
# React Plugin
#######################################################################################

plugins:
  - react

extends:
  - plugin:react/recommended

rules:
  #############################################################
  # Compatibility with default ESLint behavior
  #############################################################

  # Prevent React to be incorrectly marked as unused
  react/jsx-uses-react: error

  # Prevent variables used in JSX to be incorrectly marked as unused
  react/jsx-uses-vars: error


  #############################################################
  # Quality
  #############################################################

  # Disallow undeclared variables in JSX
  react/jsx-no-undef: error

  # Prevent missing displayName in a React component definition
  react/display-name: error

  # Enforce ES5 or ES6 class for returning value in render function
  react/require-render-return: error

  # Validate JSX has key prop when in array or iterator
  react/jsx-key: error

  # Prevent passing children as props. Bad practise
  react/no-children-prop: error

  # Prevent missing React when using JSX
  react/react-in-jsx-scope: error

  # Good idea but currently warns on too many false issues with HOCs
  react/no-unused-prop-types: off

  # Prevent multiple component definition per file
  react/no-multi-comp:
    - error
    - ignoreStateless: trrue

  # Enforce ES5 or ES6 class for React Components
  react/prefer-es6-class: error

  # Enforce stateless React Components to be written as a pure function
  react/prefer-stateless-function: error

  # Prevent missing parentheses around multilines JSX (fixable)
  react/jsx-wrap-multilines: error

  # Prevent usage of dangerous JSX properties
  react/no-danger: error

  # Prevent problem with children and props.dangerouslySetInnerHTML
  react/no-danger-with-children: error

  # Prevent direct mutation of this.state
  react/no-direct-mutation-state: error

  # Prevent invalid characters from appearing in markup
  react/no-unescaped-entities: error

  # Enforce style prop value being an object
  react/style-prop-object: error

  # Prevent duplicate props in JSX
  react/jsx-no-duplicate-props:
    - error
    - ignoreCase: true

  # Prevent usage of unsafe target='_blank'
  react/jsx-no-target-blank: error

  # Don't pollute DOM
  react/no-unknown-property: error


  #############################################################
  # Performance
  #############################################################

  # Prevent usage of setState in componentDidMount
  react/no-did-mount-set-state: error

  # Prevent usage of setState in componentDidUpdate
  react/no-did-update-set-state: error

  # Prevent usage of .bind() and arrow functions in JSX props
  react/jsx-no-bind: warn


  #############################################################
  # Style
  #############################################################

  # Validate closing bracket location in JSX (fixable)
  react/jsx-closing-bracket-location:
    - error
    - line-aligned

  # Enforce PascalCase for user-defined JSX components
  react/jsx-pascal-case:
    - error
    - allowAllCaps: true
      ignore: []

  # Restrict file extensions that may contain JSX
  react/jsx-filename-extension:
    - error
    - extensions: [ ".js" ]

  # Prevent extra closing tags for components without children (fixable)
  react/self-closing-comp: error

  # Enforce component methods order
  react/sort-comp: error

  # Enforce event handler naming conventions in JSX
  # Disabled feels too strict.
  react/jsx-handler-names: off

  # Enforce or disallow spaces inside of curly braces in JSX attributes (fixable)
  react/jsx-curly-spacing: error

  # Validate JSX indentation
  react/jsx-indent:
    - error
    - 2
    - indentLogicalExpressions: true

  # Validate props indentation in JSX
  react/jsx-indent-props:
    - error
    - 2


  #############################################################
  # Deprecated features
  #############################################################

  # Prevent usage of deprecated methods
  react/no-deprecated: error

  # Prevent usage of isMounted
  react/no-is-mounted: error

  # Prevent using string references in ref attribute.
  react/no-string-refs: error

  # Unsafe + Bad performance + Deprecated
  react/no-find-dom-node: error
{'fraction_non_alphanumeric': 0.21788220933780897, 'fraction_numerical': 0.0015257857796765334, 'mean_word_length': 3.692197566213314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2591371', 'n_tokens_mistral': 1962, 'n_tokens_neox': 1821, 'n_words': 509}