Skip to content

Commit

Permalink
Merge pull request #644 from bugsnag/v7-lint-tooling
Browse files Browse the repository at this point in the history
V7: Migrate all lint tooling to ESLint
  • Loading branch information
bengourley committed Nov 14, 2019
2 parents 30f928f + 6cddc13 commit b892a6e
Show file tree
Hide file tree
Showing 137 changed files with 7,164 additions and 22,343 deletions.
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dist
examples
features
**/node_modules/**
fixtures
scratch
coverage
packages/core/types/test/*.js
36 changes: 36 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// eslint config for .js files
module.exports = {
plugins: [
'react'
],
rules: {
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error'
},
parser: '@typescript-eslint/parser',
parserOptions: {
jsx: true,
ecmaVersion: 2018
},
overrides: [
// linting for js files
{
files: ['**/*.js'],
extends: [
'standard'
]
},
// linting for ts files
{
files: ['**/*.ts'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
],
rules: {
'@typescript-eslint/no-explicit-any': 'off'
}
}
]
}
6 changes: 3 additions & 3 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ npm run test:unit

## Type tests

This tests the validity of TypeScript typing files, and lints them using tslint.
This tests the validity of .d.ts files by attempting to compile a TypeScript program that uses Bugsnag.

```sh
npm run test:types
```

## Linting

Lints the entire repo using standardjs rules.
Lints the entire repo with ESLint. On JavaScript files this uses the [standard](https://github.com/standard/eslint-config-standard) ruleset and on TypeScript files this uses the [@typescript/eslint](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin) recommended set of rules.

```sh
npm run test:lint
Expand Down Expand Up @@ -164,4 +164,4 @@ EXPO_PROVISIONING_PROFILE_PATH=xxx \
EXPO_P12_PATH=xxx \
EXPO_IOS_DIST_P12_PASSWORD=xxx \
npm run test:expo:ios
```
```
26 changes: 13 additions & 13 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ module.exports = api => {
if (api) api.cache(false)
const presets = []
const plugins = [
[ '@babel/plugin-transform-arrow-functions' ],
[ '@babel/plugin-transform-block-scoping' ],
[ '@babel/plugin-transform-classes', { loose: true } ],
[ '@babel/plugin-transform-computed-properties', { loose: true } ],
[ '@babel/plugin-transform-destructuring', { loose: true } ],
[ '@babel/plugin-transform-member-expression-literals' ],
[ '@babel/plugin-transform-property-literals' ],
[ '@babel/plugin-transform-parameters', { loose: true } ],
[ '@babel/plugin-transform-shorthand-properties' ],
[ '@babel/plugin-transform-spread', { loose: true } ],
[ '@babel/plugin-transform-template-literals', { loose: true } ],
[ '@babel/plugin-proposal-object-rest-spread', { loose: true } ],
[ '@babel/syntax-object-rest-spread' ]
['@babel/plugin-transform-arrow-functions'],
['@babel/plugin-transform-block-scoping'],
['@babel/plugin-transform-classes', { loose: true }],
['@babel/plugin-transform-computed-properties', { loose: true }],
['@babel/plugin-transform-destructuring', { loose: true }],
['@babel/plugin-transform-member-expression-literals'],
['@babel/plugin-transform-property-literals'],
['@babel/plugin-transform-parameters', { loose: true }],
['@babel/plugin-transform-shorthand-properties'],
['@babel/plugin-transform-spread', { loose: true }],
['@babel/plugin-transform-template-literals', { loose: true }],
['@babel/plugin-proposal-object-rest-spread', { loose: true }],
['@babel/syntax-object-rest-spread']
]
return { presets, plugins }
}
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.browser
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /app
COPY package*.json ./
RUN npm install

COPY babel.config.js tslint.json lerna.json ./
COPY babel.config.js lerna.json .eslintignore .eslintrc.js ./
ADD min_packages.tar .
COPY bin ./bin
RUN npx lerna bootstrap
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /app
COPY package*.json ./
RUN npm install

COPY babel.config.js tslint.json lerna.json ./
COPY babel.config.js lerna.json .eslintignore .eslintrc.js ./
ADD min_packages.tar .
COPY bin ./bin
RUN npx lerna bootstrap
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.expo-publisher
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ WORKDIR /app
COPY package*.json ./
RUN npm install

COPY babel.config.js tslint.json lerna.json ./
COPY babel.config.js lerna.json .eslintignore .eslintrc.js ./
COPY packages ./packages
COPY bin ./bin
RUN npx lerna bootstrap
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.node
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /app
COPY package*.json ./
RUN npm install

COPY babel.config.js tslint.json lerna.json ./
COPY babel.config.js lerna.json .eslintignore .eslintrc.js ./
ADD min_packages.tar .
COPY bin ./bin
RUN npx lerna bootstrap
Expand Down

0 comments on commit b892a6e

Please sign in to comment.