diff --git a/.grit/patterns/js/sonar_autorepair.grit b/.grit/patterns/js/sonar_autorepair.grit deleted file mode 100644 index ab1edcec..00000000 --- a/.grit/patterns/js/sonar_autorepair.grit +++ /dev/null @@ -1,21 +0,0 @@ -pattern sonar_autorepair() { - or { - `class App extends $comp { $props }` where { - $props <: contains bubble or { - `static $var = $value` => `static readonly $var = $value`, - comment() => ., - `await alert($alert)` => `alert($alert)` - }, - }, - `function MyApp($_) { $_}` as $base where { - $base += `MyApp.propTypes = { - Component: PropTypes.elementType.isRequired, - pageProps: PropTypes.object - }`, - $propTypes = `PropTypes`, - $program <: contains import_statement() as $import where { - $import += `import PropTypes from 'prop-types'` - } - } - } -} diff --git a/.grit/patterns/js/sonar_fix.md b/.grit/patterns/js/sonar_fix.md deleted file mode 100644 index 3f81adc0..00000000 --- a/.grit/patterns/js/sonar_fix.md +++ /dev/null @@ -1,55 +0,0 @@ -# SonarCloud Integration - -Improve code quality by automatically remediating issues found by SonarCloud. - -```grit -language js - -sonar_autorepair() -``` - -## Sample - -```js -import { Component } from 'react'; -class App extends Component { - static readonly oneProp = "hi"; - - alertName = () => { - await alert(this.state.name); - }; - - render() { - return ( -
-

This is a somewhat bad component

- -
- ); - } -} -``` - -```js -import { Component } from 'react'; -class App extends Component { - static readonly oneProp = "hi"; - - alertName = () => { - alert(this.state.name); - }; - - render() { - return ( -
-

This is a somewhat bad component

- -
- ); - } -} -```