Skip to content

Commit c6b812d

Browse files
authored
chore: remove lint exceptions for files in examples folder (#13346)
1 parent aae0d3a commit c6b812d

File tree

19 files changed

+17
-36
lines changed

19 files changed

+17
-36
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ module.exports = {
216216
{
217217
files: ['examples/**/*'],
218218
rules: {
219-
'import/no-unresolved': ['error', {ignore: ['^react-native$']}],
220-
'import/order': 'off',
219+
'no-restricted-imports': 'off',
221220
},
222221
},
223222
{

examples/angular/app.component.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
22
import {describe, expect, it, jest} from '@jest/globals';
3-
43
import {AppComponent} from './app.component';
54
import {DataService} from './shared/data.service';
65

examples/angular/app.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Component} from '@angular/core';
2-
32
import {DataService} from './shared/data.service';
43

54
@Component({

examples/angular/app.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {NgModule} from '@angular/core';
22
import {BrowserModule} from '@angular/platform-browser';
3-
43
import {AppComponent} from './app.component';
54

65
@NgModule({

examples/angular/shared/data.service.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {TestBed} from '@angular/core/testing';
22
import {beforeEach, describe, expect, it, jest} from '@jest/globals';
3-
43
import {DataService} from './data.service';
54
import {SubService} from './sub.service';
65

examples/angular/shared/data.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Injectable} from '@angular/core';
2-
32
import {SubService} from './sub.service';
43

54
@Injectable()

examples/angular/shared/sub.service.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {TestBed} from '@angular/core/testing';
22
import {beforeEach, describe, expect, it} from '@jest/globals';
3-
43
import {SubService} from './sub.service';
54

65
describe('Service: SubService', () => {

examples/enzyme/__tests__/CheckboxWithLabel-test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
import Enzyme, {shallow} from 'enzyme';
44
import Adapter from 'enzyme-adapter-react-16';
5+
import CheckboxWithLabel from '../CheckboxWithLabel';
56

67
Enzyme.configure({adapter: new Adapter()});
78

8-
import CheckboxWithLabel from '../CheckboxWithLabel';
9-
109
it('CheckboxWithLabel changes the text after click', () => {
1110
// Render a checkbox with label in the document
1211
const checkbox = shallow(<CheckboxWithLabel labelOn="On" labelOff="Off" />);

examples/mongodb/mongo-environment.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
// mongo-environment.js
2-
const NodeEnvironment = require('jest-environment-node').default;
3-
4-
const path = require('path');
5-
6-
const fs = require('fs');
1+
import fs from 'fs';
2+
import path from 'path';
3+
import NodeEnvironment from 'jest-environment-node';
74

85
const globalConfigPath = path.join(__dirname, 'globalConfig.json');
96

examples/mongodb/setup.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
// setup.js
2-
const path = require('path');
3-
4-
const fs = require('fs');
5-
6-
const {MongoMemoryServer} = require('mongodb-memory-server');
1+
import fs from 'fs';
2+
import path from 'path';
3+
import {MongoMemoryServer} from 'mongodb-memory-server';
74

85
const globalConfigPath = path.join(__dirname, 'globalConfig.json');
96

examples/mongodb/teardown.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
// teardown.js
2-
const path = require('path');
3-
4-
const fs = require('fs');
1+
import fs from 'fs';
2+
import path from 'path';
53

64
const globalConfigPath = path.join(__dirname, 'globalConfig.json');
75

examples/react-native/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* @flow
77
*/
88

9-
import Intro from './Intro';
109
import React, {Component} from 'react';
1110
import {AppRegistry} from 'react-native';
11+
import Intro from './Intro';
1212

1313
class App extends Component<{}> {
1414
render() {

examples/react/__tests__/CheckboxWithLabel-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2004-present Facebook. All Rights Reserved.
22

33
import {createRef} from 'react';
4-
54
import * as TestUtils from 'react-dom/test-utils';
65
import CheckboxWithLabel from '../CheckboxWithLabel';
76

examples/snapshot/__tests__/clock.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
'use strict';
44

5-
import Clock from '../Clock';
65
import renderer from 'react-test-renderer';
6+
import Clock from '../Clock';
77

88
jest.useFakeTimers();
99
Date.now = jest.fn(() => 1482363367071);

examples/snapshot/__tests__/link.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
'use strict';
44

5-
import Link from '../Link';
65
import renderer from 'react-test-renderer';
6+
import Link from '../Link';
77

88
it('renders correctly', () => {
99
const tree = renderer
File renamed without changes.

examples/typescript/__tests__/CheckboxWithLabel-test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import * as React from 'react';
44
import * as TestUtils from 'react-dom/test-utils';
5-
65
const CheckboxWithLabel = require('../CheckboxWithLabel').default;
76

87
it('CheckboxWithLabel changes the text after click', () => {

examples/typescript/__tests__/calc.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
22

33
import {jest} from '@jest/globals';
4-
5-
import Memory from '../memory';
4+
import Memory from '../Memory';
5+
import makeCalc from '../calc';
66
import sub from '../sub';
77
import sum from '../sum';
8-
import makeCalc from '../calc';
98

10-
jest.mock('../memory');
9+
jest.mock('../Memory');
1110
jest.mock('../sub');
1211
jest.mock('../sum');
1312

examples/typescript/calc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import Memory from './Memory';
12
import sub from './sub';
23
import sum from './sum';
3-
import Memory from './memory';
44

55
type Op = 'MemoryAdd' | 'MemoryClear' | 'MemorySub' | 'Sub' | 'Sum';
66

0 commit comments

Comments
 (0)